0
Why is setInterval method very unstable?
4 Antworten
+ 5
What do you mean by "very unstable"?
The setInterval() method is not "unstable", but due to JS property of running in a single process ( in blocking mode: while sub-scripts runs, other will waits ), you cannot use it as a clock, meaning doesn't expect that this could be regularly and accuratly called ^^
+ 5
The time between isn't accurate because of what I previously explain...
+ 4
While studying/practicing JS timers, I cross again one solution which may interest you:
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
( 'requestAnimationFrame' method of 'window' object... )
0
I mean the time between