Comparing version 10.5.4 to 10.5.5
{ | ||
"name": "utilsac", | ||
"version": "10.5.4", | ||
"version": "10.5.5", | ||
"description": "Utility functions", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -224,17 +224,17 @@ export { | ||
const timeFunction = function (callback) { | ||
const timeFunction = function (callback, timer = Date) { | ||
// executes callback and returns time elapsed in ms | ||
const startTime = performance.now(); | ||
const startTime = timer.now(); | ||
callback(); | ||
const endTime = performance.now(); | ||
const endTime = timer.now(); | ||
return endTime - startTime; | ||
}; | ||
const timePromise = function (promiseCreator) { | ||
const timePromise = function (promiseCreator, timer = Date) { | ||
/* returns a Promise that resolves with | ||
the time elapsed for the promise to resolve and its value | ||
executes promiseCreator and waits for it to resolve */ | ||
const startTime = performance.now(); | ||
const startTime = timer.now(); | ||
return promiseCreator().then(function (value) { | ||
const endTime = performance.now(); | ||
const endTime = timer.now(); | ||
return { | ||
@@ -241,0 +241,0 @@ timeElapsed: endTime - startTime, |
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
23327