Comparing version 0.0.7 to 0.0.8
15
index.js
@@ -23,7 +23,9 @@ /** | ||
const r = elapsed / e // time for one execution | ||
results.push(+(Math.round(r + `e+${6}`) + `e-${6}`)) | ||
const result = elapsed / e | ||
results.push(+(Math.round(result + `e+${6}`) + `e-${6}`)) | ||
} | ||
const ms = (results.reduce((p, c) => p + c, 0)) // results.length | ||
const ms = (results.reduce((p, c) => p + c, 0)) / results.length | ||
if (l) { | ||
@@ -35,5 +37,12 @@ console.log(`Function : ${fn.name}()`) | ||
} | ||
return ms | ||
} | ||
function sum () { | ||
return [...arguments].reduce((p, c) => p+c, 0) | ||
} | ||
timeit(sum, args=[1, 2, 3, 4], options={e: 100000, r: 1, d: 6}) | ||
module.exports = timeit |
{ | ||
"name": "timeit-js", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Performance Measuring for Node JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -51,3 +51,3 @@ # timeit-js | ||
timeit(sum, args=[1, 2, 3, 4], options={e: 100000, r: 100, d: 2}) | ||
timeit(sum, args=[1, 2, 3, 4], options={e: 100000, r: 100, d: 6}) | ||
``` |
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
3896
35