@cjser/convert-hrtime
v5.0.0-cjser.2
Published
Convert the result of `process.hrtime.bigint()` to seconds, milliseconds, nanoseconds
Maintainers
Readme
convert-hrtime
Convert the result of
process.hrtime.bigint()to seconds, milliseconds, nanoseconds
Install
$ npm install convert-hrtimeUsage
import convertHrtime from 'convert-hrtime';
const startTime = process.hrtime.bigint();
expensiveCalculation();
const diff = process.hrtime.bigint() - startTime;
convertHrtime(diff);
//=> {seconds: 0.000002399, milliseconds: 0.002399, nanoseconds: 2399n}cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/convert-hrtime
