Comparing version 1.0.0 to 2.0.0
23
index.js
'use strict'; | ||
var convertHrtime = require('convert-hrtime'); | ||
const convertHrtime = require('convert-hrtime'); | ||
module.exports = function () { | ||
var start = process.hrtime(); | ||
module.exports = () => { | ||
const start = process.hrtime(); | ||
const end = type => convertHrtime(process.hrtime(start))[type]; | ||
var end = function (type) { | ||
return convertHrtime(process.hrtime(start))[type]; | ||
}; | ||
const ret = () => end('milliseconds'); | ||
ret.rounded = () => Math.round(end('milliseconds')); | ||
ret.seconds = () => end('seconds'); | ||
ret.nanoseconds = () => end('nanoseconds'); | ||
var ret = end.bind(null, 'ms'); | ||
ret.rounded = function () { | ||
return Math.round(end('ms')); | ||
}; | ||
ret.sec = end.bind(null, 's'); | ||
ret.nano = end.bind(null, 'ns'); | ||
return ret; | ||
}; |
{ | ||
"name": "time-span", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Simplified high resolution timing", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
@@ -41,15 +41,10 @@ "scripts": { | ||
"dependencies": { | ||
"convert-hrtime": "^1.0.0" | ||
"convert-hrtime": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^1.1.0", | ||
"delay": "^2.0.0", | ||
"in-range": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"ignores": [ | ||
"test.js" | ||
] | ||
} | ||
} |
@@ -46,7 +46,7 @@ # time-span [![Build Status](https://travis-ci.org/sindresorhus/time-span.svg?branch=master)](https://travis-ci.org/sindresorhus/time-span) | ||
#### end.sec() | ||
#### end.seconds() | ||
Seconds. | ||
#### end.nano() | ||
#### end.nanoseconds() | ||
@@ -58,2 +58,2 @@ Nanoseconds. | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3053
11
+ Addedconvert-hrtime@2.0.0(transitive)
- Removedconvert-hrtime@1.0.0(transitive)
Updatedconvert-hrtime@^2.0.0