Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@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.hrtime
values.
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,
hrtime2ms,
hrtime2
} = require('@dnlup/hrtime-utils')
const time = process.hrtime()
hrtime2ns(time) // time in nanoseconds
hrtime2ms(time) // time in milliseconds
hrtime2s(time) // time in seconds
const delta = process.hrtime(time)
hrtime2ns(delta) // delta in nanoseconds
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 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
The npm package @dnlup/hrtime-utils receives a total of 254 weekly downloads. As such, @dnlup/hrtime-utils popularity was classified as not popular.
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
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.