Repeatedly calls a function or executes a code snippet, with a fixed time delay between each call
-
callback (
CallbackAction
) Function to execute after each wait -
waitTime (
Int64
) Time to wait (in milliseconds) -
arguments (
Object[]
) Zero or more extra parameters to pass to the function
IntervalId
An interval id that can be removed with clearInterval.
Shows how to count every second
let counter = 0; setInterval(function () { counter++; Print(counter); }, 1000)