Rate this page:

setTimeout

Copy URL
setTimeout(callback: 

Function

,
timeout:

number

):

number

Sets a timer which executes a function or specified piece of code once after the timer expires.

Parameters

  • callback:

    Function

    A function to be executed after the timer expires.

  • timeout:

    number

    Optional

    The time, in milliseconds (thousandths of a second), the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute "immediately", or more accurately, as soon as possible. Note that in either case, the actual delay may be longer than intended

Returns

  • type:

    number