New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution time of callback affects timer interval #26
Comments
Sorry, but I don’t understand what the bug is supposed to be here. If you stall the execution of JavaScript with a tight loop or equivalent, you should expect that the next timer callback (or several callbacks) can be delayed. As long as you are not regularly stalling execution, it should return back to approximate integer multiples of the interval duration (so, elapsed = 4000, elapsed = 5000, elapsed = 6000, etc.). |
For the record; This bug is fixed in d3-timer 1.0.7 (d3 v4.10.2). Compare the block above (which now works) with https://bl.ocks.org/magjac/4db111095c02d6922e03d6ffea04a253 (that uses d3 v4.10.1). To clarify my expectations: If I stall the execution of JavaScript with a tight loop or equivalent for a time that is shorter than the time to the next timer callback, I expect that callback to fire on time. It now does, but before the bug was fixed, the next callback was delayed with the same amount of time that the stall lasted. However, provided that no more stalling was made, successive timer callbacks all fired on time. |
Thanks for the report! |
https://bl.ocks.org/magjac/073cbfc7c15c0b0aa56c684e1f5d69ff
See console output. Variations in the execution time of the callback affects the time interval. On my computer as much as 350 ms.
The text was updated successfully, but these errors were encountered: