node-modules/time-profile

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

time-profile

Measuring execution time of functions

NPM version build status Test coverage David deps Known Vulnerabilities npm download

A Tool to help you to measure execution time of functions.

Install
m install time-profile
Usage
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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.