|
| Timers () |
| Default to disabled.
|
|
std::map< std::string, std::chrono::microseconds > | GetAllTimers () |
| Returns a copy of all the timers used via this interface.
|
|
void | Reset () |
| Reset the timers. More...
|
|
std::chrono::microseconds | GetTimer (const std::string &timerName) |
| Returns a copy of the timer specified. More...
|
|
void | PrintTimer (const std::string &timerName) |
| Prints the specified timer. More...
|
|
void | StartTimer (const std::string &timerName, const std::thread::id &threadId=std::thread::id()) |
| Initializes a timer, available like a normal value specified on the command line. More...
|
|
void | StopTimer (const std::string &timerName, const std::thread::id &threadId=std::thread::id()) |
| Halts the timer, and replaces its value with the delta time from its start. More...
|
|
bool | GetState (const std::string &timerName, const std::thread::id &threadId=std::thread::id()) |
| Returns state of the given timer. More...
|
|
void | StopAllTimers () |
| Stop all timers.
|
|
std::atomic< bool > & | Enabled () |
| Modify whether or not timing is enabled.
|
|
bool | Enabled () const |
| Get whether or not timing is enabled.
|
|
◆ GetState()
bool Timers::GetState |
( |
const std::string & |
timerName, |
|
|
const std::thread::id & |
threadId = std::thread::id() |
|
) |
| |
Returns state of the given timer.
- Parameters
-
timerName | The name of the timer in question. |
threadId | Id of the thread accessing the timer. |
◆ GetTimer()
microseconds Timers::GetTimer |
( |
const std::string & |
timerName | ) |
|
Returns a copy of the timer specified.
This contains the sum of the timing results for timers that have been stopped with this name.
- Parameters
-
timerName | The name of the timer in question. |
◆ PrintTimer()
void Timers::PrintTimer |
( |
const std::string & |
timerName | ) |
|
Prints the specified timer.
If it took longer than a minute to complete the timer will be displayed in days, hours, and minutes as well.
- Parameters
-
timerName | The name of the timer in question. |
◆ Reset()
Reset the timers.
This stops all running timers and removes them. Whether or not timing is enabled will not be changed.
◆ StartTimer()
void Timers::StartTimer |
( |
const std::string & |
timerName, |
|
|
const std::thread::id & |
threadId = std::thread::id() |
|
) |
| |
Initializes a timer, available like a normal value specified on the command line.
Timers are of type timeval. If a timer is started, then stopped, then re-started, then stopped, the final timer value will be the length of both runs of the timer.
- Parameters
-
timerName | The name of the timer in question. |
threadId | Id of the thread accessing the timer. |
◆ StopTimer()
void Timers::StopTimer |
( |
const std::string & |
timerName, |
|
|
const std::thread::id & |
threadId = std::thread::id() |
|
) |
| |
Halts the timer, and replaces its value with the delta time from its start.
- Parameters
-
timerName | The name of the timer in question. |
threadId | Id of the thread accessing the timer. |
The documentation for this class was generated from the following files: