convert-hrtime
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

convert-hrtime

Convert the result of process.hrtime.bigint() to seconds, milliseconds, nanoseconds

Install

$ npm install convert-hrtime

Usage

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}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 5.0.0
    346,513
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 5.0.0
    346,513
  • 4.0.0
    2
  • 3.0.0
    795,748
  • 2.0.0
    11,539
  • 1.0.0
    282

Package Sidebar

Install

npm i convert-hrtime

Weekly Downloads

1,154,084

Version

5.0.0

License

MIT

Unpacked Size

3.33 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus