Sleeps for a given number of milliseconds

Version
  • 1.0.0

Example

// Sleep for 1000 milliseconds
sleep(1000).then(() => {
   console.log('1 second has passed');
});