UNPKG

bonsai-analyzer

Version:
19 lines (17 loc) 485 B
"use strict"; 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 */