mea

measure

Simple measuring of your javascript operations for node.js

Showing:

Popularity

Downloads/wk

198

GitHub Stars

4

Maintenance

Last Commit

10yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

5.9KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

This simple module mesures the duration of javascript operations. The module itself is an instance of EventEmitter2.

Example

var measure = require('measure');
var done = measure.measure('timeconsuming.operation');

measure.on('timeconsuming.*', function(duration) {
  console.log(duration); // same value as returned from done()
});

setTimeout(function() {
  var duration = done();
  console.log(duration); // ~1000 
}, 1000);

API

measure(key)

Start the measurement using the string key Returns a function to be called when the measurement is complete.

stats([key])

Return the statistics for the given key or statistics for all keys if none is given.

clear([key])

Clear stats for the given key or all keys if none is given.

Install

npm install measure

Run Tests

mocha tests/measure.test.js --reporter spec

License

MIT/X11

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial