@f/sleep
v1.0.0
Published
Sleep for n milliseconds
Downloads
96
Readme
sleep
Sleep for n milliseconds
Installation
$ npm install @f/sleep
Usage
This is particularly useful when programming with generators, e.g.
var sleep = require('@f/sleep')
function * pollThing () {
while (!thingIsReady()) {
yield sleep(100)
}
}
API
sleep(timeInMs)
timeInMs
- The time in milliseconds you want to sleep for
Returns: A promise that resolves in timeInMs
milliseconds.
License
MIT