Name: time-profile
Owner: node_modules
Description: Measuring execution time of functions
Created: 2018-05-07 08:12:04.0
Updated: 2018-05-15 08:46:21.0
Pushed: 2018-05-15 08:46:28.0
Homepage: null
Size: 7
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Measuring execution time of functions
A Tool to help you to measure execution time of functions.
m install time-profile
t Profiler = require('time-profile');
t profiler = new Profiler();
iler.start('app launch');
.. do work
iler.start('load plugins');
.. load plugins
iler.end('load plugins');
iler.start('load services');
.. load services
iler.end('load services');
iler.start('init');
.. init
iler.end('init');
..
iler.end('app launch');
n the end, you can dump the profile data to a json
t json = profiler.toJSON(); // [ Entry { name, start, end, duration, pid }, ... ]
lso you can print the profile timeline
ole.log(profiler.toString('this is timeline:'));
ash
is timeline:
?????????????????????????????????????????????? [172ms] - app launch
???????????????????????? [91ms] - load plugins
???????????? [47ms] - load services
??????????? [41ms] - init