frequency-meter

Measures event frequency

npm install frequency-meter
8 downloads in the last month

Frequency Meter Build Status

Measures the frequency of events.

Install

$ npm isntall frequency-meter

Use

Require:

var FM = require('frequency-meter');

Construct:

var fm = FM();

or construct with target emit interval (defaults to 1 second):

var fm = FM(5000); // 5 seconds

Feed it events:

setInterval(function() {
  fm.happened();
}, 100);

And listen for frequency updates:

fm.on('frequency', function(freq) {
  console.log('frequency is', freq);
});

End it:

fm.end();

License

MIT

npm loves you