Module timer.core


module timer.core
Requires modules: core , string.core

A static class for timeout related operations.

Defined in o2.timer.core.js

Class Summary

A class for executing repeated timed actions.

Usage example:

 // A unique id for the timer.
 var kCheckId = 'my_timer';

 // Auto start timer with id kCheckId to repeat doStuff approximately
 // every 500 milliseconds, please note that this is an approximation.
 // for further details see John Resig's excellent article on this:
 // http://ejohn.org/blog/how-javascript-timers-work/
 o2.Timer.set(kCheckId, doStuff, 500, {start: true, repeat: true});

 // Stops the timer (i.e. doStuff will not be executed further).
 o2.Timer.stop(kCheckId);

 // Restarts the timer (i.e. doStuff will be periodically executed again).
 o2.Timer.start(kCheckId);