try-thread-sleep

2.0.0 • Public • Published

try-thread-sleep

Use thread-sleep if native compilation succeeded, otherwise it's a noop

Build Status Dependency Status NPM version

Installation

npm install try-thread-sleep

Usage

var sleep = require('try-thread-sleep');
 
if (!sleep.native) {
  console.warn('native thread-sleep was not available');
}
 
// this next line will take roughly 1 second if native compilation succeeded,
// otherwise it will be almost instant.
sleep(1000);

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i try-thread-sleep

Weekly Downloads

404

Version

2.0.0

License

MIT

Unpacked Size

2.99 kB

Total Files

5

Last publish

Collaborators

  • forbeslindesay