an event emitter for integer-based millisecond steps.
var every = require('every')
every(33)
.on('data', function(dt) {
console.log(dt) // will always be a multiple of 33
})
create an event emitter that emits every ms
.
optionally provide your own install / uninstall functions for timers.
install functions are expected to return a handle which will then be given to the uninstall function when the timer is destroyed.
you may also provide your own now
function -- it defaults to Date.now()
.
returns whether or not the timer is paused.
pauses the timer. the timer will not emit events while paused.
resumes the timer. the timer will start emitting events again.
it will not emit the difference between pause
and resume
on the next step.
emit the current rate in milliseconds.
set the current rate in milliseconds.
uninstalls the timer function.
MIT