Access to high-resolution clock value with some basic operations. Used to calculate time durations, elapsed times etc. More...
Public Types | |
typedef std::chrono::high_resolution_clock::duration | value_type |
Time structure used. More... | |
Public Member Functions | |
clockValue () | |
Construct zero initialized. More... | |
clockValue (bool) | |
Construct with current time. More... | |
clockValue (const value_type &value) | |
Copy construct from duration with the same clock base. More... | |
const value_type & | value () const noexcept |
The time duration. More... | |
void | clear () |
Reset to zero. More... | |
void | update () |
Update to the current now() time from the system. More... | |
long | seconds () const |
The value in seconds (rounded) More... | |
clockValue | elapsed () const |
The time duration elapsed until now() since the start point. More... | |
double | elapsedTime () const |
The time elapsed [seconds] until now() since the start point. 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 clock value. More... | |
clockValue & | operator+= (const clockValue &rhs) |
Add clock value. More... | |
Static Public Member Functions | |
static clockValue | now () |
The current clock value from the system. More... | |
Access to high-resolution clock value with some basic operations. Used to calculate time durations, elapsed times etc.
Definition at line 49 of file clockValue.H.
typedef std::chrono::high_resolution_clock::duration value_type |
Time structure used.
Definition at line 58 of file clockValue.H.
|
inline |
Construct zero initialized.
Definition at line 31 of file clockValueI.H.
Referenced by clockValue::now().
|
inlineexplicit |
Construct with current time.
The bool is for tagged dispatch only (its value is ignored).
Definition at line 37 of file clockValueI.H.
|
inlineexplicit |
Copy construct from duration with the same clock base.
Definition at line 43 of file clockValueI.H.
|
inlinestatic |
The current clock value from the system.
Definition at line 23 of file clockValueI.H.
References clockValue::clockValue().
Referenced by profiling::beginTimer(), clockValue::elapsed(), and profiling::writeData().
|
inlinenoexcept |
The time duration.
Definition at line 106 of file clockValue.H.
Referenced by Foam::operator+(), and Foam::operator-().
|
inline |
Reset to zero.
Definition at line 51 of file clockValueI.H.
|
inline |
Update to the current now() time from the system.
Definition at line 57 of file clockValueI.H.
|
inline |
The value in seconds (rounded)
Definition at line 63 of file clockValueI.H.
References Foam::BitOps::count().
|
inline |
The time duration elapsed until now() since the start point.
Definition at line 69 of file clockValueI.H.
References clockValue::now().
Referenced by profiling::endTimer().
|
inline |
The time elapsed [seconds] until now() since the start point.
Definition at line 75 of file clockValueI.H.
std::string str | ( | ) | const |
Format as day-hh:mm:ss string.
Definition at line 27 of file clockValue.C.
References Foam::BitOps::count(), os(), Foam::setfill(), and Foam::setw().
|
inline |
Conversion operator to seconds in floating point.
Definition at line 83 of file clockValueI.H.
|
inline |
Subtract clock value.
Definition at line 93 of file clockValueI.H.
|
inline |
Add clock value.
Definition at line 100 of file clockValueI.H.