UnderZ

Javascript Library.

Added in v 1.0.0

Execute timer function.

Execute timer callback.


As in v 1.0.0 All examples bellow uses Timer object.

Create new timer object:

var timer = new _z.timer(function);

Please see: Timer object


Execute timer function

_z.timer.execFunction(force);

Returns: callback (function) return


Examples

// execute every 1 second
var timer1 = new _z.timer(function() { return 123456; }, 1000);

timer1.isRunning; // false
timer1.isReady(); // true
timer1.execFunction(); // EXECUTE SUCCESS return: 123456
timer1.isReady(); // false
timer1.isRunning; // true
timer1.start();
timer1.isRunning; // true
timer1.isReady(); // false
timer1.execFunction(); // EXECUTE SUCCESS return: 123456
_z.timer.hold = true;
timer1.isRunning; // false
timer1.isReady(); // false
timer1.execFunction(); // EXECUTE FAILED return: Timer object
timer1.execFunction(true); // EXECUTE SUCCESS return: 123456