Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

settime out with promise

const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time));

await sleep(500)
// Do something after the sleep!

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #settime #promise
ADD COMMENT
Topic
Name
1+2 =