setInterval
setInterval(callback: Function
, timeout: number
): number
The setInterval() method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
Parameters
callback:
Function
A function to be executed every delay milliseconds. The function is not passed any parameters, and no return value is expected.
timeout:
number
OptionalThe time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function or code. If this parameter is less than 100, a value of 100 is used. Note that the actual delay may be longer.
Returns
type:
number