目录

Timer

Definition

API

Description

setTimeout(function callback, number delay, any rest)

Sets a timer to execute the registered callback function when the timer expires and returns the timer ID. The timer ID can be passed to clearTimeout to cancel the timer.

clearTimeout(number timeoutID)

Cancels the timer set by the setTimeout() method.

setInterval(function callback, number delay, any rest)

Sets a timer to execute the registered callback function based on a specified period (in milliseconds) and returns the timer ID. The timer ID can be passed to clearInterval to cancel the timer.

clearInterval(number intervalID)

Cancels the timer set by the setInterval() method.

[h2]setTimeout(function callback, number delay, any rest)

[h2]clearTimeout(number timeoutID)

[h2]setInterval(function callback, number delay, any rest)

[h2]clearInterval(number intervalID)