|
Devel Lib
|
A high-precision timer class. More...
#include <Timer.h>
Public Member Functions | |
| CTimer (const bool i_fAutoStart=false) | |
| Constructor. More... | |
| ~CTimer ()=default | |
| Default destructor. | |
| void | start () |
| Starts or restarts the timer. | |
| void | restart () |
| Restarts the timer. | |
| bool | hasExpired (const uint64 i_nTimeMs) const |
| Checks if a certain amount of time has passed since the timer was started. More... | |
| bool | isStarted () const |
| Checks if the timer is running. More... | |
| uint64 | elapsed () const |
| Gets the elapsed time since the timer was started. More... | |
| void | clear () |
| Resets the timer. The timer is stopped and the elapsed time is set to zero. | |
| void | reset () |
| Resets the timer. The timer is stopped and the elapsed time is set to zero. | |
A high-precision timer class.
This class can be used for timekeeping, measuring the elapsed time, checking if a given time duration has expired, etc.
Example
This is an example on how to use the CTimer class.
|
inlineexplicit |
Constructor.
| i_fAutoStart | If true, the timer starts automatically upon construction. |
| uint64 Devel::CTimer::elapsed | ( | ) | const |
Gets the elapsed time since the timer was started.
|
inline |
Checks if a certain amount of time has passed since the timer was started.
| i_nTimeMs | The amount of time (in milliseconds) to check for. |
|
inline |
Checks if the timer is running.