0.0.0 • Published 12 years ago
chronotrigger v0.0.0
chronotrigger
turn events into timing information
what
takes an EventEmitter, start event, and end event. keeps timing information
and streams it when useful.
usage
chronotrigger(emitter, start_event, end_event, optional_timeout)
emitterwill have listeners attached forstart_eventandend_event- once enough data is available, an array will be streamed of:
["elapsed time from start to end", "elapsed time from end to next start"] - providing an optional third timeout argument will stream the timings after that timeout if the next event is not triggered within it.
example
var timings = require('chronotrigger'),
fs = require('fs')
timings(mouse_event_emitter, 'mouseenter', 'mouseexit')
.pipe(fs.createWriteStream('mouse-hover-times'))license
MIT
0.0.0
12 years ago