#include <Timer.hpp>
Public Member Functions | |
| void | start () |
| void | stop () |
| Timer () | |
Private Member Functions | |
| real_t | __cpuTime () |
Private Attributes | |
| real_t | __startTimeCPU |
| real_t | __stopTimeCPU |
| time_t | __startTime |
| time_t | __stopTime |
| bool | __started |
| bool | __stopped |
| struct tms | tp |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Timer &T) |
Definition at line 48 of file Timer.hpp.
| Timer::Timer | ( | ) | [inline] |
Definition at line 110 of file Timer.hpp.
00112 : __startTimeCPU(0), 00113 __stopTimeCPU(0), 00114 __startTime(0), 00115 __stopTime(0), 00116 __started(false), 00117 __stopped(false) 00118 #endif // __MINGW32__ 00119 { 00120 ; 00121 }
| real_t Timer::__cpuTime | ( | ) | [inline, private] |
| void Timer::start | ( | ) | [inline] |
Definition at line 72 of file Timer.hpp.
References __cpuTime(), __started, __startTime, __startTimeCPU, __stopped, ASSERT, and NULL.
Referenced by FiniteElementMethod::__discretizeOnMesh(), FictitiousDomainMethod::__discretizeOnMesh(), SpectralFEMPreconditioner::Internal::__solveFEM(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleMatrix(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleMatrix(), SpectralLegendreDiscretizationNonConform::assembleSecondMember(), SpectralLegendreDiscretizationConform::assembleSecondMember(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleSecondMember(), FFThread::run(), and KrylovSolver::solve().
00073 { 00074 #ifndef __MINGW32__ 00075 ASSERT(!__started); 00076 __started=true; 00077 __stopped=false; 00078 __startTime = std::time(NULL); 00079 __startTimeCPU = __cpuTime(); 00080 #endif // __MINGW32__ 00081 }

| void Timer::stop | ( | ) | [inline] |
Definition at line 83 of file Timer.hpp.
References __cpuTime(), __started, __stopped, __stopTime, __stopTimeCPU, ASSERT, and NULL.
Referenced by FiniteElementMethod::__discretizeOnMesh(), FictitiousDomainMethod::__discretizeOnMesh(), SpectralFEMPreconditioner::Internal::__solveFEM(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleMatrix(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleMatrix(), SpectralLegendreDiscretizationNonConform::assembleSecondMember(), SpectralLegendreDiscretizationConform::assembleSecondMember(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleSecondMember(), FFThread::run(), and KrylovSolver::solve().
00084 { 00085 #ifndef __MINGW32__ 00086 ASSERT(__started); 00087 __started=false; 00088 __stopped=true; 00089 00090 __stopTime = std::time(NULL); 00091 __stopTimeCPU = __cpuTime(); 00092 #endif // __MINGW32__ 00093 }

| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Timer & | T | |||
| ) | [friend] |
Definition at line 95 of file Timer.hpp.
00096 { 00097 #ifndef __MINGW32__ 00098 if (!T.__stopped) { 00099 os << "Timer not stopped\n"; 00100 return os; 00101 } 00102 os << "time: " << std::difftime(T.__stopTime, T.__startTime) << 's' 00103 << " - CPU time: " << T.__stopTimeCPU - T.__startTimeCPU << 's'; 00104 #else // __MINGW32__ 00105 os << "time: not implemented under windows"; 00106 #endif // __MINGW32__ 00107 return os; 00108 }
real_t Timer::__startTimeCPU [private] |
real_t Timer::__stopTimeCPU [private] |
time_t Timer::__startTime [private] |
time_t Timer::__stopTime [private] |
bool Timer::__started [private] |
bool Timer::__stopped [private] |
struct tms Timer::tp [read, private] |
1.5.6