bonsai-analyzer
Version:
Trim your dependency tree.
19 lines (17 loc) • 485 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = withTimings;
/* eslint-disable no-console */
function withTimings(scope, action) {
return (fn, ...args) => {
console.timeStamp(`${scope} start: ${action}`);
console.time(`${scope}: ${action}`);
const result = fn(...args);
console.timeEnd(`${scope}: ${action}`);
console.timeStamp(`${scope} end: ${action}`);
return result;
};
}
/* eslint-enable no-console */