nav-title | title | description |
---|---|---|
Module timer |
Module timer |
Module timer |
// To import the "timer" module:
var timer = require("timer");
- setTimeout( callback Function, milliseconds? Number ) Number
Calls a function after a specified delay.- callback - Function
The function to be called. - milliseconds - (optional) - Number
The time to wait before the function is called. Defaults to 0. - return - Number
- callback - Function
- clearTimeout( id Number )
Clears the delay set by a call to the setTimeout function.- id - Number
The identifier returned by the previously called setTimeout() method.
- id - Number
- setInterval( callback Function, milliseconds? Number ) Number
Calls a function repeatedly with a delay between each call.- callback - Function
The function to be called. - milliseconds - (optional) - Number
The delay between each function call. - return - Number
- callback - Function
- clearInterval( id Number )
Clears repeated function which was set up by calling setInterval().- id - Number
The identifier returned by the setInterval() method.
- id - Number