0.1.2 • Published 7 years ago

promise-profiler v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

profile-profiler

Track promise & non-promise execution time

Install

npm install profile-profiler --save

Usage

Patch function

fn = profiler.patch(fn, 'name');    //name can be omit to use function name

Patch object

profiler.patch(obj, 'name');    //name can be omit to use class name

Turn profiler on/off

profiler.active = true; //or false for off

Get report

let result = profiler.report();
//[
//  { name: 'fnName', sum: 1000, min: 20, max: 150, avg: 100, count: 10 }    
//]