Class | Joyau::Timer |
In: |
Drawable.cpp
|
Parent: | Object |
This class allows to count the ellapsed seconds between two moments. You can pause that timer, but notice that, since it is based on timestamps, it’s still running while the PSP is not.
Returns the ellapsed time since the timer’s creation.
/* Returns the ellapsed time since the timer's creation. */ VALUE Timer_getTime(VALUE self) { Timer &ref = getRef<Timer>(self); int ret = ref.getTime(); return INT2FIX(ret); }
Pauses the timer.
/* Pauses the timer. */ VALUE Timer_pause(VALUE self) { Timer &ref = getRef<Timer>(self); ref.pause(); return Qnil; }
Returns whether the timer is paused.
/* Returns whether the timer is paused. */ VALUE Timer_paused(VALUE self) { Timer &ref = getRef<Timer>(self); return ref.isPaused() ? Qtrue : Qfalse; }
Restarts the timer from zero.
/* Restarts the timer from zero. */ VALUE Timer_reset(VALUE self) { Timer &ref = getRef<Timer>(self); ref.reset(); return Qnil; }