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.

Methods

getTime   pause   paused   paused?   reset   resume   time  

Public Instance methods

Returns the ellapsed time since the timer’s creation.

[Source]

/*
  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.

[Source]

/*
  Pauses the timer.
*/
VALUE Timer_pause(VALUE self)
{
   Timer &ref = getRef<Timer>(self);
   ref.pause();

   return Qnil;
}

Returns whether the timer is paused.

[Source]

/*
  Returns whether the timer is paused.
*/
VALUE Timer_paused(VALUE self)
{
   Timer &ref = getRef<Timer>(self);
   return ref.isPaused() ? Qtrue : Qfalse;
}
paused?()

Alias for paused

Restarts the timer from zero.

[Source]

/*
  Restarts the timer from zero.
*/
VALUE Timer_reset(VALUE self)
{
   Timer &ref = getRef<Timer>(self);
   ref.reset();

   return Qnil;
}

Resumes the timer.

[Source]

/*
  Resumes the timer.
*/
VALUE Timer_resume(VALUE self)
{
   Timer &ref = getRef<Timer>(self);
   ref.resume();

   return Qnil;
}
time()

Alias for getTime

[Validate]