Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "retimer", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Reschedulable Timer for your node needs", | ||
@@ -34,5 +34,8 @@ "main": "retimer.js", | ||
"pre-commit": "^1.0.10", | ||
"standard": "^10.0.0", | ||
"standard": "^12.0.0", | ||
"tape": "^4.0.0" | ||
}, | ||
"browser": { | ||
"./time.js": "./time-browser.js" | ||
} | ||
} |
@@ -10,4 +10,4 @@ # retimer [![Build Status](https://travis-ci.org/mcollina/retimer.png)](https://travis-ci.org/mcollina/retimer) | ||
* `benchSetTimeout*100`: 51867ms | ||
* `benchRetimer*100`: 34237ms | ||
* `benchSetTimeout*100: 36912.680ms` | ||
* `benchRetimer*100: 33213.134ms` | ||
@@ -14,0 +14,0 @@ ## Install |
'use strict' | ||
var assert = require('assert') | ||
var getTime = require('./time') | ||
@@ -42,5 +42,10 @@ function Retimer (callback, timeout, args) { | ||
function retimer () { | ||
assert.equal(typeof arguments[0], 'function', 'callback needed') | ||
assert.equal(typeof arguments[1], 'number', 'timeout needed') | ||
if (typeof arguments[0] !== 'function') { | ||
throw new Error('callback needed') | ||
} | ||
if (typeof arguments[1] !== 'number') { | ||
throw new Error('timeout needed') | ||
} | ||
var args | ||
@@ -59,7 +64,2 @@ | ||
function getTime () { | ||
var t = process.hrtime() | ||
return Math.floor(t[0] * 1000 + t[1] / 1000000) | ||
} | ||
module.exports = retimer |
Sorry, the diff of this file is not supported yet
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
7898
9
186