0 points

Nodejs Sleep


dashboard

Tue May 26 2020 08:47:42 GMT+0000 (UTC)

Posted by @salitha.pathi #javascript

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

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