Skip to content

module_wait

wait ⇒ Promise.<void>

A function that returns a promise that resolves after a specified delay.

Returns: Promise.<void> - - A promise that resolves after the specified delay.

ParamTypeDefaultDescription
[delay]number0The delay, in milliseconds, before the promise should resolve.

Example

async function async() {
await wait(2000)
console.log("Something")
}
async()