convert-hrtime
Convert the result of `process.hrtime()` to seconds, milliseconds, nanoseconds
Last updated 8 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install convert-hrtime 
SYNC missed versions from official npm registry.

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}

Current Tags

  • 5.0.0                                ...           latest (4 years ago)

5 Versions

  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |