Replace setTimeout with requestAnimationFrame #3
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
vlw/monkeydo!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/3/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Monkeydo relies on the highly volatile
setTimeout()to chain scheduled tasks.setTimeout()is both susceptible to unannounced thread sleeping and also time drift. I have therefore replaced it with the generally more stable and consistentwindow.requestAnimationFrame().This is a refactor and does not change the upstream developer-facing API.
next()has been renamed totick()and contains the whole event scheduler now.Any custom implementation calling
next()will therefore stop working.