Access to high-resolution clock value with some basic operations. Used to calculate time durations, elapsed times etc. More...
#include <clockValue.H>
Public Types | |
| typedef std::chrono::high_resolution_clock::duration | value_type |
| Time structure used. | |
Public Member Functions | |
| clockValue () | |
| Construct zero initialized. | |
| clockValue (bool) | |
| Construct with current time. | |
| clockValue (const value_type &value) | |
| Copy construct from duration with the same clock base. | |
| const value_type & | value () const noexcept |
| The time duration. | |
| void | clear () |
| Reset to zero. | |
| void | update () |
| Update to the current now() time from the system. | |
| long | seconds () const |
| The value in seconds (rounded). | |
| clockValue | elapsed () const |
| The time duration elapsed until now() since the start point. | |
| double | elapsedTime () const |
| The time elapsed [seconds] until now() since the start point. | |
| std::string | str () const |
| Format as day-hh:mm:ss string. | |
| operator double () const | |
| Conversion operator to seconds in floating point. | |
| clockValue & | operator-= (const clockValue &rhs) |
| Subtract clock value. | |
| clockValue & | operator+= (const clockValue &rhs) |
| Add clock value. | |
Static Public Member Functions | |
| static clockValue | now () |
| The current clock value from the system. | |
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 now(), operator+=(), and operator-=().

|
inlineexplicit |
Construct with current time.
The bool is for tagged dispatch only (its value is ignored).
Definition at line 37 of file clockValueI.H.
References now().

|
inlineexplicit |
Copy construct from duration with the same clock base.
Definition at line 43 of file clockValueI.H.
References value().

|
inlinestatic |
The current clock value from the system.
Definition at line 23 of file clockValueI.H.
References clockValue().
Referenced by profiling::beginTimer(), clockValue(), elapsed(), and profiling::writeData().


|
inlinenoexcept |
The time duration.
Definition at line 106 of file clockValue.H.
References Foam::noexcept.
Referenced by clockValue(), 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.
|
inline |
The time duration elapsed until now() since the start point.
Definition at line 69 of file clockValueI.H.
References now().
Referenced by elapsedTime(), and profiling::endTimer().


|
inline |
The time elapsed [seconds] until now() since the start point.
Definition at line 75 of file clockValueI.H.
References elapsed().

| std::string str | ( | ) | const |
Format as day-hh:mm:ss string.
Definition at line 27 of file clockValue.C.
References os().

|
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.
References clockValue(), and Foam::rhs().

|
inline |
Add clock value.
Definition at line 100 of file clockValueI.H.
References clockValue(), and Foam::rhs().
