ch

convert-hrtime

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

Showing:

Popularity

Downloads/wk

363K

GitHub Stars

41

Maintenance

Last Commit

5mos ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100