Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 18, 2024 via pnpm

pretty-hrtime 1.0.3

process.hrtime() to words
Package summary
Share
0
issues
1
license
1
MIT
Package created
9 Dec 2013
Version published
5 Nov 2016
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
pretty-hrtime@1.0.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of pretty-hrtime 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does pretty-hrtime do?

Pretty-hrtime is a handy npm package that converts the results of the Node.js process.hrtime() function to human-readable words. The purpose of process.hrtime() function is to return the current high-resolution real time in a [seconds, nanoseconds] array, and Pretty-hrtime translates this array into a more intuitive format. This feature saves the developer's time in having to manually parse out these times for their application or system metrics.

How do you use pretty-hrtime?

You can easily implement pretty-hrtime by first installing it to your Node.js project through npm. After installing, you'll need to require it at the top of your file to begin using it. From there, get a starting point for your high-resolution time using the process.hrtime() method, perform the operations that you wish to measure, and then get an ending time point. Use these starting and ending time points to determine the time spent, and then feed this elapsed time into the prettyHrtime function for a human-readable result. Below is an example of how to use pretty-hrtime in your JavaScript code:

var prettyHrtime = require('pretty-hrtime');

var start = process.hrtime();
// Perform your operations here
var end = process.hrtime(start);

var words = prettyHrtime(end);
console.log(words); // Might output '1.2 ms'

words = prettyHrtime(end, {verbose:true});
console.log(words); // Might output '1 millisecond 209 microseconds'

words = prettyHrtime(end, {precise:true});
console.log(words); // Might output '1.20958 ms'

Where are the pretty-hrtime docs?

The documentation for pretty-hrtime can be found in its GitHub repository located at git://github.com/robrich/pretty-hrtime.git. It's a well-documented source providing usage examples and other additional details about integrating and using the package correctly in your projects. Whether you are new to using third-party packages or an experienced developer, the docs are straightforward and easy to understand. Do note that using pretty-hrtime requires Node.js version 0.7.6 or later, as prior versions do not support the process.hrtime() method.