timer-dev
v0.1.0
Published
This is a small util for checking the performance of a function or promise.
Downloads
1
Readme
Timer
This is a small util for checking the performance of a function or promise.
Installation
npm install --save-dev timer-dev
Usage
import { wrap } from 'timer-dev';
const func = (param) => {
return 'result: ' + param;
};
const timedFunction = wrap(func);
const timedResult = timedFunction('my param');
console.log(timedResult.result); // result: my param
console.log(timedResult.execTimeInMs)