Socket
Socket
Sign inDemoInstall

browser-process-hrtime

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-process-hrtime

Shim for process.hrtime in the browser


Version published
Weekly downloads
9.6M
increased by2.87%
Maintainers
1
Weekly downloads
 
Created

What is browser-process-hrtime?

The browser-process-hrtime package is a browser shim for Node.js's process.hrtime. It allows you to get high-resolution real-time stamps with nanosecond precision, which is useful for performance testing, benchmarking, or tracking the time between events with high accuracy.

What are browser-process-hrtime's main functionalities?

High-resolution time stamps

This feature allows you to measure precise time intervals. The code sample demonstrates how to get the current high-resolution real-time stamp, wait for 1 second using setTimeout, and then get another time stamp to calculate the duration.

const now = require('browser-process-hrtime');
const start = now();
setTimeout(function () {
  const end = now(start);
  console.log('seconds:', end[0]);
  console.log('nanoseconds:', end[1]);
}, 1000);

Other packages similar to browser-process-hrtime

FAQs

Package last updated on 12 Jan 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc