UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

13 lines (12 loc) 420 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.timeIt = void 0; const functionWrapper_1 = require("./functionWrapper"); function timeIt(fn) { return (0, functionWrapper_1.createFunctionWrapper)(fn, { before: (ctx) => { ctx.state.start = Date.now(); }, after: (ctx) => (Date.now() - ctx.state.start) })(); } exports.timeIt = timeIt; exports.default = timeIt;