A class for a hierarchical timer functions.
More...
#include <Timer.hpp>
|
| | Timer () |
| | Creates a Timer with an unnamed root node.
|
| |
| | Timer (const Key &rootKey) |
| | Creates a Timer with a named root node.
|
| |
| void | tick (const Key &timerName) |
| | Starts a named timer.
|
| |
| void | tock (const Key &timerName) |
| | Stops a named timer.
|
| |
| void | tock () |
| | Stop the last timer to be started.
|
| |
| double | lap (const Key &timerName) const |
| | Returns the elapsed time without stopping the timer.
|
| |
| double | elapsed (const Key &timerName) const |
| | Returns the elapsed time.
|
| |
| std::ostream & | report (const Key &timerName, std::ostream &os) const |
| | Prints the status of a named timer to an ostream.
|
| |
| std::ostream & | report (std::ostream &os) const |
| | Prints the status of all the timers to an ostream.
|
| |
| std::ostream & | report (const TimerPath &, std::ostream &os) const |
| | Prints the status of a timer specified by a path to an ostream.
|
| |
| void | additionalTime (const TimerPath &path, WallTimeDuration additionalWall, CpuTimeDuration additionalCpu, int additionalTicks) |
| | Adds an additional time increment to a timer.
|
| |
| TimerPath | currentTimerNodePath () const |
| | Returns the timer path to the currently running timer.
|
| |
| void | reset () |
| | Deletes all timers except the root, which is reset.
|
| |
|
| static Timer | main |
| | Static timer for general use.
|
| |
A class for a hierarchical timer functions.
Definition at line 23 of file Timer.hpp.
◆ CpuTimeDuration
◆ CpuTimePoint
◆ Key
| std::string Nextsim::Timer::Key |
◆ TimerPath
| std::forward_list<Key> Nextsim::Timer::TimerPath |
◆ WallTimeDuration
◆ WallTimePoint
◆ Timer() [1/2]
| Nextsim::Timer::Timer |
( |
| ) |
|
Creates a Timer with an unnamed root node.
Definition at line 22 of file Timer.cpp.
◆ Timer() [2/2]
| Nextsim::Timer::Timer |
( |
const Key & | rootKey | ) |
|
Creates a Timer with a named root node.
- Parameters
-
| rootKey | Name of the root node. |
Definition at line 27 of file Timer.cpp.
◆ additionalTime()
| void Nextsim::Timer::additionalTime |
( |
const TimerPath & | path, |
|
|
WallTimeDuration | additionalWall, |
|
|
CpuTimeDuration | additionalCpu, |
|
|
int | additionalTicks ) |
Adds an additional time increment to a timer.
- Parameters
-
| path | Path to the timer to be incremented. |
| additionalWall | Wall clock duration to be added. |
| additionalCpu | CPU clock duration to be added. |
| additionalTicks | Activation ticks to be added. |
Definition at line 65 of file Timer.cpp.
◆ currentTimerNodePath()
| Timer::TimerPath Nextsim::Timer::currentTimerNodePath |
( |
| ) |
const |
Returns the timer path to the currently running timer.
Definition at line 78 of file Timer.cpp.
◆ elapsed()
| double Nextsim::Timer::elapsed |
( |
const Key & | timerName | ) |
const |
Returns the elapsed time.
- Parameters
-
| timerName | the name of the timer to interrogate. |
Definition at line 63 of file Timer.cpp.
◆ lap()
| double Nextsim::Timer::lap |
( |
const Key & | timerName | ) |
const |
Returns the elapsed time without stopping the timer.
- Parameters
-
| timerName | the name of the timer to interrogate. |
Definition at line 62 of file Timer.cpp.
◆ report() [1/3]
| std::ostream & Nextsim::Timer::report |
( |
const Key & | timerName, |
|
|
std::ostream & | os ) const |
Prints the status of a named timer to an ostream.
- Parameters
-
| timerName | The timer to be printed. |
| os | The ostream to print to. |
Definition at line 94 of file Timer.cpp.
◆ report() [2/3]
| std::ostream & Nextsim::Timer::report |
( |
const TimerPath & | path, |
|
|
std::ostream & | os ) const |
Prints the status of a timer specified by a path to an ostream.
- Parameters
-
| path | The path to the timer to be printed. |
| os | The ostream to print to. |
Definition at line 101 of file Timer.cpp.
◆ report() [3/3]
| std::ostream & Nextsim::Timer::report |
( |
std::ostream & | os | ) |
const |
Prints the status of all the timers to an ostream.
- Parameters
-
| os | The ostream to print to. |
Definition at line 99 of file Timer.cpp.
◆ reset()
| void Nextsim::Timer::reset |
( |
| ) |
|
Deletes all timers except the root, which is reset.
Definition at line 110 of file Timer.cpp.
◆ tick()
| void Nextsim::Timer::tick |
( |
const Key & | timerName | ) |
|
Starts a named timer.
- Parameters
-
| timerName | Name of the timer to be started. |
Definition at line 35 of file Timer.cpp.
◆ tock() [1/2]
| void Nextsim::Timer::tock |
( |
| ) |
|
Stop the last timer to be started.
Definition at line 50 of file Timer.cpp.
◆ tock() [2/2]
| void Nextsim::Timer::tock |
( |
const Key & | timerName | ) |
|
Stops a named timer.
- Parameters
-
| timerName | Name of the timer to be stopped. |
Definition at line 48 of file Timer.cpp.
◆ main
| Timer Nextsim::Timer::main |
|
static |
Static timer for general use.
Definition at line 109 of file Timer.hpp.
The documentation for this class was generated from the following files: