utils.js 304 B

1234567891011
  1. "use strict";
  2. // Browserify's process implementation doesn't have hrtime, and this package is small so not much of a burden for
  3. // Node.js users.
  4. const hrtime = require("browser-process-hrtime");
  5. function toMS([sec, nanosec]) {
  6. return sec * 1e3 + nanosec / 1e6;
  7. }
  8. module.exports = { hrtime, toMS };