Pause the execution of code for a specified duration.
The number of milliseconds to pause the execution.
A Promise that resolves after the specified duration.
async function example() { console.log('Start'); await sleep(1000); console.log('After 1 second');} Copy
async function example() { console.log('Start'); await sleep(1000); console.log('After 1 second');}
Pause the execution of code for a specified duration.