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 Apr 9, 2024 via pnpm

performance-now 2.1.0

Implements performance.now (based on process.hrtime).
Package summary
Share
0
issues
1
license
1
MIT
Package created
22 May 2013
Version published
19 Feb 2017
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:
performance-now@2.1.0
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 performance-now 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does performance-now do?

Performance-now is a JavaScript module that implements a function similar to performance.now, based on Node.js native process.hrtime function. Essentially, it allows measuring time with sub-millisecond precision in Node applications. Unlike the standard clock time, the time reported by performance-now is monotonically increasing, keeping it safe from clock-drift issues.

How do you use performance-now?

To use performance-now, you will need to install it via npm and then use require to include it in your project. Here is an example on how to use it in your JavaScript code:

// Install the module first with npm install performance-now

// Then, in your JavaScript code, require the module
var now = require("performance-now");

// You can then use it to measure the time
var start = now();
// Execute your code here
var end = now();

// You can then calculate the time difference 
console.log((end - start).toFixed(3)); // Time in milliseconds taken by your code

This couldn't be simpler: just call the now() function before and after the code you want to measure the time of. The numbers returned by now() are in milliseconds with sub-millisecond precision.

Where are the performance-now docs?

The documentation for performance-now is relatively limited and is primarily found in the README.md file available in the GitHub repository, at git://github.com/braveg1rl/performance-now.git. The repository provides crucial details about its installation and usage including a basic code example. For more detailed usage, the module mirrors the interface of the standard performance.now method you can find in modern web browsers, therefore existing standard documentation for this method is also applicable to performance-now.