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 3.1.0 to 3.1.1

16

index.js

@@ -1,12 +0,14 @@

var S = 's'
var MS = 'ms'
var NS = 'ns'
'use strict'
var round = number => Math.round(number * 100) / 100
const S = 's'
const MS = 'ms'
const NS = 'ns'
const round = number => Math.round(number * 100) / 100
function hirestimeNode() {
var start = process.hrtime()
const start = process.hrtime()
return unit => {
var elapsed = process.hrtime(start)
let elapsed = process.hrtime(start)

@@ -26,3 +28,3 @@ switch (unit) {

function hiresTimeBrowser() {
var start = Date.now()
const start = Date.now()

@@ -29,0 +31,0 @@ return unit => {

{
"name": "hirestime",
"version": "3.1.0",
"version": "3.1.1",
"description": "thin wrapper around process.hrtime",

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

@@ -7,4 +7,4 @@ # hirestime [![Build Status](https://api.travis-ci.org/seriousManual/hirestime.png)](https://travis-ci.org/seriousmanual/hirestime)

hirestime is a thin wrapper around `process.hrtime()` that does the clumsy handling of the returned array for you.
Since version 2.1 this module also works in the browser.
`hirestime` is a thin wrapper around `process.hrtime()` that does the clumsy handling of the returned array for you.
Also works in the browser.

@@ -21,6 +21,7 @@ ## Installation

### returnedFunction([unit])
returns the elapsed time since the call of `hirestime` in milliseconds.
an optional unit parameter can be specified that will cause an recalculation.
possible parameters
Returns the elapsed time since the call of `hirestime` in milliseconds.
An optional unit parameter can be specified that will modify the unit in which the elapsed time will be calculated.
#### Possible Parameters
* `hirestime.S` elapsed time in seconds

@@ -32,7 +33,8 @@ * `hirestime.MS` elapsed time in milliseoncds

By default the time is measured in milliseconds:
````javascript
var hirestime = require('../')
const hirestime = require('hirestime')
//startpoint of the time measurement
var getElapsed = hirestime()
const getElapsed = hirestime()

@@ -45,7 +47,8 @@ setTimeout(_ => {

Optionally the unit can be set to be seconds or nanoseconds:
````javascript
var hirestime = require('../')
const hirestime = require('hirestime')
//startpoint of the time measurement
var getElapsed = hirestime()
const getElapsed = hirestime()

@@ -52,0 +55,0 @@ setTimeout(_ => {

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