MAF.utility.timer Singleton

MAF.utility.timer()

Methods

clearInterval(timer)

Stop and destroy a Timer.

Parameters:

Name Type Description
timer Timer

The timer to destroy.

clearTimeout(timer)

Stop and destroy a Timer.

Parameters:

Name Type Description
timer Timer

The timer to destroy.

setInterval(callback, interval) → {Timer}

Create a timer that will trigger a callback each time the defined interval has expired.

Parameters:

Name Type Description
callback function

Method to execute everytime the timer triggers.

interval Number

Time in miliseconds.

Returns:

The created timer object.

setTimeout(callback, interval) → {Timer}

Create a timer that will trigger a callback when the defined interval has expired. After its triggered it will stop.

Parameters:

Name Type Description
callback function

Method to execute when the timer triggers.

interval Number

Time in miliseconds.

Returns:

The created timer object.