npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

time-perf

v2.0.2

Published

A simple object to evaluate the performance of a function|application|algorithm

Readme

TimePerf

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.

Documentation (click here)

Installation

npm install time-perf

Quick start

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)

Latest features :

We know you wanted to do this, at least we wanted to: get/create identified TimePerf instance

  • You can now create new TimePerf instance and access it through the TimePerf singleton with the newInstance/getInstance function

Rename for better readibility

  • Better use print to print measure durations (resume still an alias)
  • For permanent duration measure and easiest duration analysis use getTime(index)

TimePerf made some children ! You can now create children in each step.

  • To do it use 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.
Use example
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)

More features

  • TimePerf functions can be chained
  • You can pause and unpause
  • TimePerf can display any previous action result with log
  • print will display the last step result when chained to step
timePerf.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 TimePerf
timePerf.stop("Last step");
//..
timePerf.unpause()
  • start will reset and step TimePerf. You can call it at any time to restart TimePerf

Dev

To regenerate documentation jsdoc --configure documentation/jsdoc.json