try-thread-sleep

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

MIT 4 个版本
安装
npm install try-thread-sleep
yarn add try-thread-sleep
pnpm add try-thread-sleep
bun add try-thread-sleep
README

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

版本列表
2.0.0 2018-05-10
1.0.2 2017-02-26
1.0.1 2017-02-26
1.0.0 2015-01-15