Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript sleep 1 second

setTimeout(() => console.log("First"), 1000)
setTimeout(() => console.log("Second"), 1000)
setTimeout(() => console.log("Third"), 1000)

for (let i = 1; i <= 3; i++) {
  setTimeout(() => console.log(`#${i}`), 1000)
}
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #javascript #sleep
ADD COMMENT
Topic
Name
9+2 =