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)
emitter
will have listeners attached forstart_event
andend_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 = fs =
license
MIT