rolex
Drift-minimizing setInterval replacement and high-precision timer utility for Node and browser
Installation
In Node: npm install rolex
In browser:
- Copy
rolex.js
or rolex.min.js
(with optional source map at rolex.min.js.map
) <script src="path/to/rolex.{min.}js"></script>
setInterval
and clearInterval
are automatically replaced -- if this is undesired, Rolex.noConflict();
Usage
var Rolex = require('rolex'); // Node only
var p = Rolex(10, function () {
console.log('executes in 10 ms');
}).start();
More examples in test/rolex.js.