MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <MsqTimer.hpp>
Public Member Functions | |
StopWatch () | |
void | start () |
void | stop () |
void | reset () |
double | total_time () const |
int | number_of_starts () const |
Returns the number of times this StopWatch has been started. | |
Private Attributes | |
bool | isRunning |
double | timeAtLastStart |
double | totalTime |
int | numStarts |
Definition at line 65 of file MsqTimer.hpp.
MBMesquite::StopWatch::StopWatch | ( | ) | [inline] |
Definition at line 70 of file MsqTimer.hpp.
int MBMesquite::StopWatch::number_of_starts | ( | ) | const [inline] |
Returns the number of times this StopWatch has been started.
Definition at line 90 of file MsqTimer.hpp.
{ return numStarts; }
void MBMesquite::StopWatch::reset | ( | ) |
Definition at line 113 of file MsqTimer.cpp.
void MBMesquite::StopWatch::start | ( | ) |
Definition at line 94 of file MsqTimer.cpp.
{ if( !isRunning ) { isRunning = true; timeAtLastStart = now(); ++numStarts; } }
void MBMesquite::StopWatch::stop | ( | ) |
Definition at line 104 of file MsqTimer.cpp.
{ if( isRunning ) { isRunning = false; totalTime += now() - timeAtLastStart; } }
double MBMesquite::StopWatch::total_time | ( | ) | const |
Definition at line 120 of file MsqTimer.cpp.
{ double rv = totalTime; if( isRunning ) rv += now() - timeAtLastStart; return rv; }
bool MBMesquite::StopWatch::isRunning [private] |
Definition at line 96 of file MsqTimer.hpp.
int MBMesquite::StopWatch::numStarts [private] |
Definition at line 99 of file MsqTimer.hpp.
double MBMesquite::StopWatch::timeAtLastStart [private] |
Definition at line 97 of file MsqTimer.hpp.
double MBMesquite::StopWatch::totalTime [private] |
Definition at line 98 of file MsqTimer.hpp.