Access to high-resolution clock value with some basic operations. More...
Public Member Functions | |
clockValue () | |
Construct zero initialized. More... | |
clockValue (const value_type &value) | |
Construct from duration with the same clock base. More... | |
clockValue (bool useNow) | |
Construct zero initialized or with current time. More... | |
const value_type & | value () const |
Return the value. More... | |
void | clear () |
Reset to zero. More... | |
void | update () |
Update to the current now() time from the system. More... | |
clockValue | elapsed () const |
The time elapsed from now() since the start time. More... | |
long | seconds () const |
The value in seconds (rounded) More... | |
std::string | str () const |
Format as day-hh:mm:ss string. More... | |
operator double () const | |
Conversion operator to seconds in floating point. More... | |
clockValue & | operator-= (const clockValue &rhs) |
Subtract time value. More... | |
clockValue & | operator+= (const clockValue &rhs) |
Add time value. More... | |
Static Public Member Functions | |
static clockValue | now () |
Return the current time value from the system. More... | |
Access to high-resolution clock value with some basic operations.
Definition at line 51 of file clockValue.H.
clockValue | ( | ) |
Construct zero initialized.
Definition at line 36 of file clockValue.C.
Referenced by clockValue::now().
|
explicit |
Construct from duration with the same clock base.
Definition at line 42 of file clockValue.C.
|
explicit |
Construct zero initialized or with current time.
Definition at line 48 of file clockValue.C.
References clockValue::update().
|
inlinestatic |
Return the current time value from the system.
Definition at line 78 of file clockValue.H.
References clockValue::clockValue().
Referenced by profiling::beginTimer(), and profiling::writeData().
|
inline |
Return the value.
Definition at line 87 of file clockValue.H.
Referenced by Foam::operator+(), and Foam::operator-().
void clear | ( | ) |
Reset to zero.
Definition at line 61 of file clockValue.C.
void update | ( | ) |
Update to the current now() time from the system.
Definition at line 67 of file clockValue.C.
Referenced by clockValue::clockValue().
Foam::clockValue elapsed | ( | ) | const |
The time elapsed from now() since the start time.
Definition at line 73 of file clockValue.C.
Referenced by profiling::endTimer(), and regionSplit::reduceRegions().
long seconds | ( | ) | const |
The value in seconds (rounded)
Definition at line 79 of file clockValue.C.
std::string str | ( | ) | const |
Format as day-hh:mm:ss string.
Definition at line 85 of file clockValue.C.
References Foam::setfill(), and Foam::setw().
operator double | ( | ) | const |
Conversion operator to seconds in floating point.
Definition at line 133 of file clockValue.C.
Foam::clockValue & operator-= | ( | const clockValue & | rhs | ) |
Subtract time value.
Definition at line 143 of file clockValue.C.
Foam::clockValue & operator+= | ( | const clockValue & | rhs | ) |
Add time value.
Definition at line 150 of file clockValue.C.