Function executions don't overlapโthey just pile up. An interval of 100 may suggest starting times around 100, 200, 300, and 400 but the reality is that setInterval can continue to queue up work faster than the work can be processed. So the work actually starts at 100, 250, 350, and 550 (or even later if in between interval tasks the event loop processes some other events, promises resolve etc.).
The "overlapping animation" scenario could happen with concurrent but distinct animations stepping recursively through requestAnmationFrame() but there each animation step is a separately scheduled function - the entire animation isn't one single continuously running function.
Ah yes, but for your eyes it would cause overlap depending on your animations ofcourse.
It would pile up and freak out, which is rarely what you'll want.
Thanks for the detailed explanation here :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Function executions don't overlapโthey just pile up. An interval of 100 may suggest starting times around 100, 200, 300, and 400 but the reality is that
setIntervalcan continue to queue up work faster than the work can be processed. So the work actually starts at 100, 250, 350, and 550 (or even later if in between interval tasks the event loop processes some other events, promises resolve etc.).The "overlapping animation" scenario could happen with concurrent but distinct animations stepping recursively through requestAnmationFrame() but there each animation step is a separately scheduled function - the entire animation isn't one single continuously running function.
Ah yes, but for your eyes it would cause overlap depending on your animations ofcourse.
It would pile up and freak out, which is rarely what you'll want.
Thanks for the detailed explanation here :)