JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 309
  • Score
    100M100P100Q3306F
  • License MIT

A better setInterval/setTimeout

Package Exports

  • rolex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rolex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rolex

Drift-minimizing setInterval replacement and high-precision timer utility for Node and browser

Comparison between setInterval, rolex, and recursive setTimeout

Installation

In Node: npm install rolex

In browser:

  1. Copy rolex.js or rolex.min.js (with optional source map at rolex.min.js.map)
  2. <script src="path/to/rolex.{min.}js"></script>
  3. 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.