function setInterval
Jump to headingsetInterval<TArgs extends any[]>(callback: (...args: TArgs) => void,ms?: number,...args: TArgs,): TimeoutSchedules repeated execution of callback every delay milliseconds.
When delay is larger than 2147483647 or less than 1, the delay will be
set to 1. Non-integer delays are truncated to an integer.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using timersPromises.setInterval().
Type Parameters Jump to heading
Jump to headingTArgs extends any[]Parameters Jump to heading
Jump to headingcallback: (...args: TArgs) => voidThe function to call when the timer elapses.
optional
Jump to headingms: numberJump to heading<span>...args</span>: TArgsReturn Type Jump to heading
for use with clearInterval
Jump to headingsetInterval(callback: (args: void) => void,ms?: number,): TimeoutParameters Jump to heading
Jump to headingcallback: (args: void) => voidoptional
Jump to headingms: number