Nodejs Sleep

PHOTO EMBED

Tue May 26 2020 08:47:42 GMT+0000 (Coordinated Universal Time)

Saved by @salitha.pathi #javascript

await sleep(1000)
function sleep(ms) {
  return new Promise((resolve) => {
    setTimeout(resolve, ms);
  });
} 
content_copyCOPY

https://stackoverflow.com/questions/14249506/how-can-i-wait-in-node-js-javascript-l-need-to-pause-for-a-period-of-time