47 explicit CTimer(
const bool i_fAutoStart =
false) {
74 [[nodiscard]]
bool isStarted()
const {
return this->m_fIsStarted; }
88 void reset() { this->m_fIsStarted =
false; }
103 std::chrono::time_point<std::chrono::steady_clock> m_oStartTime;
110 std::chrono::time_point<std::chrono::system_clock> m_oStartTime;
This file contains a series of type definitions for the codebase.
unsigned long long uint64
A 64-bit unsigned integer type.
Definition: Typedef.h:11
A high-precision timer class.
Definition: Timer.h:43
void clear()
Resets the timer. The timer is stopped and the elapsed time is set to zero.
Definition: Timer.h:84
void restart()
Restarts the timer.
Definition: Timer.h:62
bool isStarted() const
Checks if the timer is running.
Definition: Timer.h:74
void reset()
Resets the timer. The timer is stopped and the elapsed time is set to zero.
Definition: Timer.h:88
CTimer(const bool i_fAutoStart=false)
Constructor.
Definition: Timer.h:47
uint64 elapsed() const
Gets the elapsed time since the timer was started.
Definition: Timer.cpp:8
void start()
Starts or restarts the timer.
Definition: Timer.cpp:3
bool hasExpired(const uint64 i_nTimeMs) const
Checks if a certain amount of time has passed since the timer was started.
Definition: Timer.h:68
~CTimer()=default
Default destructor.
A namespace for development related classes and functions.