Fork me on GitHub

Module ringo/scheduler

This module provides support for scheduling invocation of functions.

Functions


clearInterval (id)

Cancel a timeout previuosly scheduled with setInterval().

Parameters

object id the id object returned by setInterval()

clearTimeout (id)

Cancel a timeout previuosly scheduled with setTimeout().

Parameters

object id the id object returned by setTimeout()

setInterval (callback, delay, [args])

Calls a function repeatedly, with a fixed time delay between each call to that function.

Parameters

function callback a function
number delay the delay in milliseconds
[args] optional arguments to pass to the function

Returns

object an id object useful for cancelling the scheduled invocation

setTimeout (callback, delay, [args])

Executes a function after specified delay.

Parameters

function callback a function
number delay the delay in milliseconds
[args] optional arguments to pass to the function

Returns

object an id object useful for cancelling the scheduled invocation