If I'm writing javascript that contains a lot of intervals, I tend to keep track of them in a array of interval objects
function Interval(id, desc){
this.id = id;
this.desc = desc;
}
prototypes etc....
Then I create my interval functions with something like
intervalArray.push(new Interval(setInterval(function, milli),"Demo interval"))
I know this is verging on OCD, but trust me, it has made problem solving easier as it's simpler to keep track of the wretched things at the dev tools prompt when you want to clearInterval on one or two of them when running.
So the question...
Given an interval id, is there any way to access its current status?
ie if I have an interval x set to a repeat time of 300000 to fire every five minutes, is there any way to get x.timer, a function that, after one minute would return 60000?
A couple of times now, while debugging, it would have been useful to know how close a given interval was to firing.
I guess I could add another value to my interval object - .lastFired, initiate it with 0 and update it with a timestamp when it fires off but presumably the browser keeps track of intervals somewhere...