Seconds between calls.
Function to be called.
Optional
immediate: booleanWhether or not to call the callback immediately, rather than wait for the first interval (default false
).
Cancellation function.
const cancel = SetInterval(1, () => {
print("This code runs every 1 second");
});
// Optionally call the cancel function stop the loop:
cancel();
Continuously calls the callback function every
interval
seconds.