Skip to main content
function setInterval
setInterval(
cb: (...args: any[]) => void,
delay?: number,
...args: any[],
): number
Deprecated

Repeatedly calls a function , with a fixed time delay between each call.

// Outputs 'hello' to the console every 500ms
setInterval(() => { console.log('hello'); }, 500);

Parameters

cb: (...args: any[]) => void
optional
delay: number
<span>...args</span>: any[]

Return Type

number
Back to top