Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hirestime

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hirestime - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

index.js

@@ -1,4 +0,4 @@

var S = 'seconds';
var MS = 'milliseconds';
var NS = 'nanoseconds';
var S = 's';
var MS = 'ms';
var NS = 'ns';

@@ -8,9 +8,9 @@ function hirestime() {

return function(unit) {
return function (unit) {
var elapsed = process.hrtime(start);
var time;
if(unit === S) time = elapsed[0] + elapsed[1] / 1e9;
else if(unit === NS) time = elapsed[0] * 1e9 + elapsed[1];
else if(unit === MS || !unit || !time) time = elapsed[0] * 1e3 + elapsed[1] / 1e6;
if (unit === S) time = elapsed[0] + elapsed[1] / 1e9;
else if (unit === NS) time = elapsed[0] * 1e9 + elapsed[1];
else if (unit === MS || !unit || !time) time = elapsed[0] * 1e3 + elapsed[1] / 1e6;

@@ -17,0 +17,0 @@ return parseInt(time * 100, 10) / 100;

{
"name": "hirestime",
"version": "1.0.1",
"version": "1.0.2",
"description": "thin wrapper around process.hrtime",

@@ -5,0 +5,0 @@ "main": "index.js",

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