
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A simple object to evaluate the performance of a function|application|algorithm
light performance measure tool
TimePerf is a simple npm module to evaluate et measure a javascript application. TimePerf is a singleton it can be require in through several modules/files.
npm install time-perf
var timePerf = require('time-perf');
timePerf.start('Test');
// ..execute algorithm to evaluate
timePerf.step('Algorithm').print();
// Will display "> 1. Algorithm : 127 ms"
// ..execute a function to evaluate
timePerf.stop('Function').print();
timePerf.print();
// Will display :
--------------------------------
- TimePerf result -
--------------------------------
# Test
+ TimePerf duration : 200 ms
+ Pause duration : 0 ms
> 1. Algorithm : 63.5 % (127 ms)
> 2. Function : 36.5 % (73 ms)
We know you wanted to do this, at least we wanted to: get/create identified TimePerf instance
Rename for better readibility
print to print measure durations (resume still an alias)getTime(index)TimePerf made some children ! You can now create children in each step.
child or even faster childStart and childStop to make quick child.
A child is a TimePerf object you can use it as its parent.
You can add as much child and as deep as you want to.timePerf.start('Test').childStart('SmallChild 1');
// .. some stuff
timePerf.childStop().childStart('SmallChild 2');
// .. more stuff
timePerf.lastChild().stop();
timePerf.step('Parent 1');
var perfChild = timePerf.child().start('BigChild');//same as timePerf.childStart('BigChild')
// ..inside step
perfChild.step('inside step 1');
timePerf.childStop('inside step 2').stop('Parent 2').print();
// Will display
--------------------------------
- TimePerf result -
--------------------------------
## Test
+ TimePerf duration : 19609 ms
+ Pause duration : 0 ms
> 1. Parent 1 : 0.54 % (105 ms)
> SmallChild 1 : 12 ms
> SmallChild 2 : 92 ms
> 2. Parent 2 : 99.46 % (19504 ms)
## BigChild
+ TimePerf duration : 19504 ms
+ Pause duration : 0 ms
> 1. inside step 1 : 65.56 % (12787 ms)
> 2. inside step 2 : 34.44 % (6717 ms)
pause and unpauselogprint will display the last step result when chained to steptimePerf.start();
timePerf.step("First step").print().pause();
// display "\[TimePerf] > 1. First Step : 20 ms"
timePerf.unpause().log();
// display "TimePerf has marked a 4 ms pause"
stop will step and pause TimePerftimePerf.stop("Last step");
//..
timePerf.unpause()
start will reset and step TimePerf. You can call it at any time to restart TimePerfTo regenerate documentation
jsdoc --configure documentation/jsdoc.json
FAQs
A simple object to evaluate the performance of a function|application|algorithm
The npm package time-perf receives a total of 11 weekly downloads. As such, time-perf popularity was classified as not popular.
We found that time-perf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.