supertux
|
Simple timer designed to be used in the update functions of objects. More...
#include <timer.hpp>
Public Member Functions | |
void | start (float period, bool cyclic=false) |
start the timer with the given period (in seconds). More... | |
bool | check () |
returns true if a period (or more) passed since start call or last successful check | |
void | stop () |
stop the timer | |
void | pause () |
pause the timer | |
void | resume () |
resume (unpause) the timer | |
float | get_period () const |
returns the period of the timer or 0 if it isn't started | |
float | get_timeleft () const |
float | get_timegone () const |
float | get_progress () const |
bool | started () const |
bool | paused () const |
Simple timer designed to be used in the update functions of objects.
void Timer::start | ( | float | period, |
bool | cyclic = false |
||
) |
start the timer with the given period (in seconds).
If cyclic=true then the timer will be reset after each period. Set period to zero if you want to disable the timer.