1.0.0 • Published 8 years ago

@f/sleep v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

sleep

Build status Git tag NPM version Code style

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