setTimeout

Functionin globals@fastly/js-compute 4.0.0View source
setTimeout(callback: (...args: TArgs) => void, delay?: number, ...args: any): number

The setTimeout() method sets a timer which calls a function once the timer expires.

See also

Parameters

callback: (...args: TArgs) => void

A function to be called after the timer expires.

delay: numberoptional

The time, in milliseconds, that the timer should wait before calling the specified function. Defaults to 0 if not specified.

...args: any

Additional arguments which are passed through to the callback function.

Returns

number

A numeric, non-zero value which identifies the timer created; this value can be passed to clearTimeout() to cancel the timeout.