21 #include "hx3d/utils/timer.hpp" 31 _delay(delay), _elapsed(0), _alreadyEnded(false), _loop(loop)
43 _alreadyEnded =
false;
50 long elapsed = _elapsed * 1000;
51 return std::max(0L, _delay - elapsed);
void update(float delta)
Update the timer.
void reset()
Reset the timer.
void initialize(long delay, bool loop=false)
Initialize the timer with a delay.
bool hasEnded()
Test if the timer has ended.
bool isLooping()
Is the timer looping ?
Timer()
Create an uninitialized timer. See initialize.
long remaining()
Get the remaining time as milliseconds.