EventEmitter + Timer + Counter. Easily generate time events for testing.
// 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"
- needs more/better tests and docs
ISC