UNPKG

probe.gl

Version:

JavaScript Console Instrumentation and Benchmarking for Browser and Node

27 lines (20 loc) 606 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTimestamp = getTimestamp; exports.startTimestamp = void 0; var _globals = require("./globals"); function getTimestamp() { if (!_globals.isBrowser) { var secondsAndNanoseconds = _globals.process.hrtime(); return secondsAndNanoseconds[0] + secondsAndNanoseconds[1] / 1e6; } if (_globals.window.performance) { return _globals.window.performance.now(); } return Date.now(); } var startTimestamp = getTimestamp(); exports.startTimestamp = startTimestamp; //# sourceMappingURL=timestamp.js.map