29static constexpr unsigned MILLISECONDS_IN_A_TICK = 10;
Simple timer that can be used to check if a certain amount of time has passed.
bool passed() const
Returns whether the timer has passed.
int32_t elapsed() const
Returns the number of milliseconds elapsed since the set time, or a negative value if the timer hasn'...
void reset()
Reset the timer.
bool isSet() const
Returns whether the timer has been set.
void extend(uint32_t ms)
Extend the timer by the given number of milliseconds.
void set(uint32_t ms=0)
Sets the timer with an optional duration in milliseconds.
unsigned deltaTimeMs()
The time in milliseconds since the last frame, but never more than 1000.
float deltaTime()
The time in seconds since the last frame, but never more than 1.
void beginFrame()
Called at the start of each frame, updates the above variables.
uint32_t absoluteTimeMs()
The time in milliseconds since the program started (wraps around after ~49 days).