#include <Timer.h>
Timer utility class
Helper class for timing events When an instance of this class goes out of scope, it prints the elapsed time (prefixed by the event name)
Code inspired by: https://stackoverflow.com/questions/2808398/easily-measure-elapsed-time
- Author
- Thomas Kroes
◆ Timer()
| Timer::Timer |
( |
const QString & |
event = "" | ) |
|
Constructor
- Parameters
-
| event | Name of the event to measure (when empty, elapsed time is not printed when this object goes out of scope) |
◆ ~Timer()
◆ elapsedTime()
| std::int64_t Timer::elapsedTime |
( |
const SteadyClock & |
start | ) |
const |
Returns the elapsed time
- Parameters
-
| start | The start time of the time interval |
- Returns
- Elapsed time
◆ elapsedTimeMilliseconds()
| float Timer::elapsedTimeMilliseconds |
( |
const SteadyClock & |
start | ) |
const |
Returns the elapsed time
- Parameters
-
| start | The start time of the time interval |
- Returns
- Elapsed time in milliseconds
◆ printElapsedTime()
| void Timer::printElapsedTime |
( |
const QString & |
event, |
|
|
const bool & |
reset = false |
|
) |
| |
Prints the elapsed time since the timer was created
- Parameters
-
| event | Name of the event |
| reset | Whether to reset the start time |
◆ printTotalTime()
| void Timer::printTotalTime |
( |
| ) |
|
|
protected |
Prints the elapsed time since the timer was created
◆ reset()
Resets the start time of the timer
The documentation for this class was generated from the following files:
- D:/Work/ManiVault/DevBundle/allmain/source/core/HDPS/src/util/Timer.h
- D:/Work/ManiVault/DevBundle/allmain/source/core/HDPS/src/util/Timer.cpp