thread-sleep-compat
v1.4.1
Published
thread-sleep the runs on multiple versions of node
Readme
thread-sleep-compat
thread-sleep the runs on multiple versions of node
Please see the original thread-sleep module for details.
Usage
var sleep = require('thread-sleep-compat');
var start = Date.now();
var res = sleep(1000);
var end = Date.now();
// res is the actual time that we slept for
console.log(res + ' ~= ' + (end - start) + ' ~= 1000');
// tested on osx and resulted in => 1005 ~= 1010 ~= 1000Prebuilt binaries
Node 0.x below 0.12 has no usable thread-sleep release, so this package ships prebuilt addons for
those versions under assets/thread-sleep/bin/, one directory per
thread-sleep-compat-node-<abi>-<platform>-<arch>. Every other Node uses the thread-sleep
dependency and never touches them.
They are committed artifacts, regenerated by hand and reviewed in the diff. To refresh them: run the
Build Binaries workflow, download its per-platform artifacts and commit them.
npm run build:binaries does the same for the current platform only.
