# convert-hrtime

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

Latest version **5.0.0** (published 2021-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install convert-hrtime
pnpm add convert-hrtime
yarn add convert-hrtime
bun add convert-hrtime
```

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2021-04-14 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/convert-hrtime) |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | process, hrtime, time, highres, performance, bench, benchmark, measure, seconds, milliseconds, nanoseconds |

## Links

- npm: https://www.npmjs.com/package/convert-hrtime
- Repository: https://github.com/sindresorhus/convert-hrtime
- Homepage: https://github.com/sindresorhus/convert-hrtime#readme
- Issues: https://github.com/sindresorhus/convert-hrtime/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/convert-hrtime

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2021-04-14
- 4.0.0 — 2021-04-07
- 3.0.0 — 2019-04-09
- 2.0.0 — 2017-05-23
- 1.0.0 — 2015-12-10

## README

# convert-hrtime

> Convert the result of [`process.hrtime.bigint()`](https://nodejs.org/api/process.html#process_process_hrtime_bigint) to seconds, milliseconds, nanoseconds

## Install

```
$ npm install convert-hrtime
```

## Usage

```js
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}
```

---
_Source: https://npm.io/package/convert-hrtime · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
