setInterval
function
function setInterval<TArgs extends any[]>(cb: (...args: TArgs) => void, delay?: number, ...args: TArgs): numberRepeatedly calls a function , with a fixed time delay between each call.
// Outputs 'hello' to the console every 500ms
setInterval(() => { console.log('hello'); }, 500);
function
function setInterval(cb: string | ((...args: any[]) => void), delay?: number, ...args: any[]): number