0.1.0 • Published 4 years ago

timer-dev v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

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)