Skip to main content

Melon.std.time.setInterval(action, delay)

Sets a timer which executes a function or specified piece of code once the timer expires and do it repeatedly in loop.

Status: unstable
Returns: string

Parameters​

NameTypeDescription
actionFunctionThe function that will be executed after the delay
delaynumberThe delay in milisseconds

Example usage​

Note

This function is also available globally, so can be directly called without importing

function helloWorld() {
console.log("Hello World!");
}

const timeoutId = setInterval(helloWorld, 3000);