
logtime-interval
When you would like a timer callback to fire based on the timestamp of the data you are processing - the timestamp of the data stream when you created the timer rather than real time.
When you are processing older time series data may need to do a particular action for every one of a specific timespan of data.
var manager = require('logtime-interval')(0);
manager.setTimeout(function(){
console.log(i fired!);
},1000)
manager.setTime(1000);
api
module.exports is a function it returns a new object to manager timers.
manager.setTime
- sets the current time and triggers execution of any pending timers
manager.setTimeout
manager.setInterval
manager.clearTimeout
- setTimeout returns an id
- if you pass that id to clearTimeout and it has not been called it will not be called
manager.clearInterval
- setInterval returns an id
- if you pass that id to setInterval it will not be called again