1.0.0 • Published 7 years ago

event-test-clock-pmb v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

event-test-clock-pmb

EventEmitter + Timer + Counter. Easily generate time events for testing.

Usage

// var makeClock = require('event-test-clock-pmb');
cfg = Object.assign({ intvName: 'qtrSec', intvSec: 0.25 }, cfg);
var clk = makeClock(cfg);
clk.on('qtrSec', function (t) {
  if (clk.verbose) { console.log(String(clk), 'tick', t, clk.intvName); }
  clk.emitNthTicks('halfSec', 2);
  clk.emitNthTicks('fullSec', 4);
  clk.emitNthTicks('dblSec',  8);
});
// for more demo, see package "event-historian-pmb"

Known issues

  • needs more/better tests and docs

 

License

ISC