timer-dev
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i timer-dev

Weekly Downloads

6

Version

0.1.0

License

ISC

Unpacked Size

9.45 kB

Total Files

12

Last publish

Collaborators

  • ordermind