mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Replaced timely dependency
This commit is contained in:
11
client/app/scripts/utils/timer-utils.js
Normal file
11
client/app/scripts/utils/timer-utils.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// Replacement for timely dependency
|
||||
|
||||
export default function timer(fn) {
|
||||
const timedFn = (...args) => {
|
||||
const start = new Date();
|
||||
const result = fn.apply(fn, args);
|
||||
timedFn.time = new Date() - start;
|
||||
return result;
|
||||
};
|
||||
return timedFn;
|
||||
}
|
||||
Reference in New Issue
Block a user