Browser & Node, ES7 sleep()
Pauses the execution (without freezing the Browser/thread) the requested ammount of milliseconds.
The implementaton in based in the native Promises
, and requires the usage of await
.
asymc { // some code... await ; // continue execution...}
Package distribution networks :
In browser enviroment you can include this library using the jsdelivr CDN ...
If you are in the NodeJs enviroment, can install and import the package via:
$ npm install js-sleep
// importconst sleep = ;