@karimsa/bench
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -240,2 +240,24 @@ var __create = Object.create; | ||
}, | ||
timeSync(name, fn2) { | ||
const startId = uuid(); | ||
import_perf_hooks.performance.mark(startId); | ||
try { | ||
return fn2(); | ||
} finally { | ||
const endId = uuid(); | ||
import_perf_hooks.performance.mark(endId); | ||
import_perf_hooks.performance.measure(name, startId, endId); | ||
} | ||
}, | ||
async timeAsync(name, fn2) { | ||
const startId = uuid(); | ||
import_perf_hooks.performance.mark(startId); | ||
try { | ||
return await fn2(); | ||
} finally { | ||
const endId = uuid(); | ||
import_perf_hooks.performance.mark(endId); | ||
import_perf_hooks.performance.measure(name, startId, endId); | ||
} | ||
}, | ||
resetTimer() { | ||
@@ -242,0 +264,0 @@ startTime = microtime.now(); |
{ | ||
"private": false, | ||
"name": "@karimsa/bench", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Minimal benchmarking JS library.", | ||
@@ -12,3 +12,5 @@ "main": "bench.dist.js", | ||
"scripts": { | ||
"build": "esbuild --target=node12 bench.js --format=cjs --outfile=bench.dist.js" | ||
"build": "esbuild --target=node12 bench.js --format=cjs --outfile=bench.dist.js", | ||
"format": "prettier --write bench.js", | ||
"lint": "prettier --check bench.js" | ||
}, | ||
@@ -15,0 +17,0 @@ "devDependencies": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
16371
5
409
4