Rate this page:

setInterval

Copy URL
setInterval(callback: 

Function

,
timeout:

number

):

number

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 specified milliseconds. The function should not have any parameters, and no return value is expected.

  • timeout:

    number

    Optional

    The time, in milliseconds (thousandths of a second), the timer specifies the delay 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 might be longer.

Returns

  • type:

    number