Skip to main content

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

Sets a timer which executes a function or specified piece of code once the timer expires.

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 = setTimeout(helloWorld, 3000);