DOM Style Timers
The Timers API provides functionality to allow developers to create DOM style timers.
- Source:
- See:
Methods
(static) clearImmediate(id)
Cancels an Immediate timer created by setImmediate().
Parameters:
Name | Type | Description |
---|---|---|
id |
Number
|
The ID which identifies the timer. |
(static) clearInterval(id)
The global clearInterval() method cancels an interval previously established by calling setInterval().
Parameters:
Name | Type | Description |
---|---|---|
id |
Number
|
The ID which identifies the timer. |
(static) clearTimeout(id)
The global clearTimeout() method cancels a timeout previously established by calling setTimeout().
Parameters:
Name | Type | Description |
---|---|---|
id |
Number
|
The ID which identifies the timer. |
(static) setImmediate(callback, …argsopt) → {Number}
Schedules the "immediate" execution of the callback after the I/O phase.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function
|
A function to be executed after the I/O ( |
|
args |
any
|
<optional> <repeatable> |
Additional arguments which are passed through to the function. |
Returns:
- Type:
-
Number
The ID which identifies the timer created.
(static) setInterval(callback, delay, …argsopt) → {Number}
Repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function
|
A function to be executed every |
|
delay |
Number
|
The milliseconds the timer should delay in between executions. |
|
args |
any
|
<optional> <repeatable> |
Additional arguments which are passed through to the function. |
Returns:
- Type:
-
Number
The ID which identifies the timer created.
(static) setTimeout(callback, delay, …argsopt) → {Number}
Sets a timer which executes a function or specified piece of code once the timer expires.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function
|
A function to be executed after the timer expires. |
|
delay |
Number
|
The milliseconds that the timer should wait before the function is executed. |
|
args |
any
|
<optional> <repeatable> |
Additional arguments which are passed through to the function. |
Returns:
- Type:
-
Number
The ID which identifies the timer created.