Epetra_Time.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_TIME_H
00033 #define EPETRA_TIME_H
00034 
00036 
00046 #include "Epetra_Object.h"
00047 #include "Epetra_Comm.h"
00048 
00049 #ifdef EPETRA_MPI
00050 #include "mpi.h"
00051 #else 
00052 #if ICL || defined(_WIN32)
00053 #include <time.h>
00054 #else
00055 #include <sys/time.h>
00056 #ifndef MINGW
00057 #include <sys/resource.h>
00058 #endif
00059 #endif
00060 #endif
00061 
00062 class Epetra_Time: public Epetra_Object {
00063     
00064   public:
00066 
00070   Epetra_Time(const Epetra_Comm & Comm);
00071 
00073 
00075   Epetra_Time(const Epetra_Time& Time);
00076 
00078 
00082   double WallTime(void) const;
00083 
00085 
00089   void ResetStartTime(void);
00090 
00092 
00098   double ElapsedTime(void) const;
00099 
00101 
00103   virtual ~Epetra_Time(void);
00104 
00105   Epetra_Time& operator=(const Epetra_Time& src)
00106     {
00107       StartTime_ = src.StartTime_;
00108       Comm_ = src.Comm_;
00109       return( *this );
00110     }
00111 
00112  private:
00113 
00114   double StartTime_;
00115   const Epetra_Comm * Comm_;
00116   
00117 };
00118 
00119 #endif /* EPETRA_TIME_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7