thread-sleep-compat
v0.1.1
Published
thread-sleep the runs on multiple versions of node
Downloads
90
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 ~= 1000