Rate this page:

setInterval

Copy URL
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

    Optional

    The 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 10, a value of 10 is used. Note that the actual delay may be longer.

Returns

  • type:

    number