frequency-meter

Measures event frequency

Frequency Meter

Measures the frequency of events.

$ npm isntall frequency-meter

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);
});

MIT