
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@dnlup/hrtime-utils
Advanced tools
A small collection of useful functions to work with Node.js `process.hrtime` values
A small collection of useful functions to work with Node.js
process.hrtimevalues.
hrtime-utils is a tiny module that exports a few useful functions that you can use to convert the value returned from process.hrtime() to a time unit.
$ npm i @dnlup/hrtime-utils
const {
hrtime2ns,
hrtime2us,
hrtime2ms,
hrtime2
} = require('@dnlup/hrtime-utils')
const time = process.hrtime()
hrtime2ns(time) // time in nanoseconds
hrtime2us(time) // time in microseconds
hrtime2ms(time) // time in milliseconds
hrtime2s(time) // time in seconds
const delta = process.hrtime(time)
hrtime2ns(delta) // delta in nanoseconds
hrtime2us(delta) // delta in microseconds
hrtime2ms(delta) // delta in milliseconds
hrtime2s(delta) // delta in seconds
time <integer[]> The return value of a process.hrtime() call
Returns <number>
This function converts time to nanoseconds.
time <integer[]> The return value of a process.hrtime() call
Returns <number>
This function converts time to microseconds.
time <integer[]> The return value of a process.hrtime() call
Returns <number>
This function converts time to milliseconds.
time <integer[]> The return value of a process.hrtime() call
Returns <number>
This function converts time to seconds.
FAQs
A small collection of useful functions to work with Node.js `process.hrtime` values
We found that @dnlup/hrtime-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.