netxsimdg
|
A class providing a timer. More...
#include <Chrono.hpp>
Public Types | |
typedef std::chrono::high_resolution_clock::time_point | WallTimePoint |
Type of a point in time for the wall clock. | |
typedef std::chrono::high_resolution_clock::duration | WallTimeDuration |
Type of a time duration on the wall clock. | |
typedef std::clock_t | CpuTimePoint |
Type of a point in time for the CPU clock. | |
typedef double | CpuTimeDuration |
Type of a time duration on the CPU clock. | |
Public Member Functions | |
Chrono () | |
Default constructor of a chronometer, zeroing all of the counters. | |
WallTimePoint | wallHack () const |
Returns the current time on the wall clock. | |
WallTimeDuration | wallTime () const |
Returns the current cumulative wall clock time. | |
void | reset () |
Resets all of the chronometer counters. | |
CpuTimePoint | cpuHack () const |
Returns the current time on the CPU clock. | |
CpuTimeDuration | cpuTime () const |
Returns the current cumulative CPU clock timer. | |
int | ticks () const |
Returns the current number of activation ticks. | |
bool | running () const |
Returns whether this chronometer is running. | |
void | start () |
Starts the timer. | |
void | stop () |
Stops the timer. | |
void | extraCpuTime (const CpuTimeDuration &extraTime) |
Adds an externally determined increment to the CPU clock. | |
void | extraWallTime (const WallTimeDuration &extraTime) |
Adds an externally determined increment to the wall clock. | |
void | extraTicks (int extraTicks) |
Adds an externally determined increment to the activation count. | |
A class providing a timer.
This class records execution wall and CPU time as well as a record of the number of times that the chronometer has been started.
Definition at line 21 of file Chrono.hpp.
Type of a time duration on the CPU clock.
Definition at line 31 of file Chrono.hpp.
std::clock_t Nextsim::Chrono::CpuTimePoint |
Type of a point in time for the CPU clock.
Definition at line 29 of file Chrono.hpp.
std::chrono::high_resolution_clock::duration Nextsim::Chrono::WallTimeDuration |
Type of a time duration on the wall clock.
Definition at line 26 of file Chrono.hpp.
std::chrono::high_resolution_clock::time_point Nextsim::Chrono::WallTimePoint |
Type of a point in time for the wall clock.
Definition at line 24 of file Chrono.hpp.
|
inline |
Default constructor of a chronometer, zeroing all of the counters.
Definition at line 34 of file Chrono.hpp.
|
inline |
Returns the current time on the CPU clock.
Definition at line 59 of file Chrono.hpp.
|
inline |
Returns the current cumulative CPU clock timer.
Definition at line 61 of file Chrono.hpp.
|
inline |
Adds an externally determined increment to the CPU clock.
extraTime | the additional duration to be added to the CPU clock. |
Definition at line 103 of file Chrono.hpp.
|
inline |
Adds an externally determined increment to the activation count.
extraTicks | the additional ticks to be added to the activation count. |
Definition at line 116 of file Chrono.hpp.
|
inline |
Adds an externally determined increment to the wall clock.
extraTime | the additional duration to be added to the wall clock. |
Definition at line 109 of file Chrono.hpp.
|
inline |
Resets all of the chronometer counters.
Definition at line 50 of file Chrono.hpp.
|
inline |
Returns whether this chronometer is running.
Definition at line 69 of file Chrono.hpp.
|
inline |
Starts the timer.
Starts the clock on both the wall and CPU clocks, increments the number of activation ticks and sets the running flag.
Definition at line 77 of file Chrono.hpp.
|
inline |
Stops the timer.
Stops both the wall and CPU clocks, updates the cumulative time for both clocks and unsets the running flag.
Definition at line 91 of file Chrono.hpp.
|
inline |
Returns the current number of activation ticks.
Definition at line 67 of file Chrono.hpp.
|
inline |
Returns the current time on the wall clock.
Definition at line 42 of file Chrono.hpp.
|
inline |
Returns the current cumulative wall clock time.
Definition at line 44 of file Chrono.hpp.