My original question was about a block of code similar to this:
delayTime = 1000;
reducedDelay = 0;
setInterval(
function(){
//Code which calculates reduced delay
reducedDelay = /* -- Any integer -- */;
delayTime = 1000 - reducedDelay;
},delayTime)
delayTime
is a global scope variable, so to my understanding, delayTime
would be updated by the expression delayTime = 1000 - reducedDelay;
and so the setInterval
would call the function again with the updated delayTime
delay... right?
And this is just one use, but I was not able to find a way to actually check the delay of a setInterval()
or setTimeout()
. How could one check the delayTime
(the second argument)?
A better way to phrase it: How could one check the setTimeout()
or setInterval('param 1', 'param 2')
<-- 'param 2' being the delay, how would one check if the setInterval
is actually performing correctly? (I.e. delaying the next call of 'param 1' by the correct time.)