Skip to content
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

requestAnimationFrame update for clock #151

Merged
merged 4 commits into from
Oct 26, 2020

Conversation

andOrlando
Copy link
Collaborator

closes #135
switches setInterval to requestAnimationFrame, change the constant to change the frames/second or remove the constant altogether if you feel like hardcoding it. Also if you feel like it's best you could fix redraw_clock so it works with requestAnimationFrame but you could also just keep it as separate functions which is what I suggest.

from setInterval, this doesn't do it every 1000, it just kinda goes.
Apparently it's more dynamic or something but since it's an issue I did
it.
once every 4 seconds but this can be changed by editing the
refreshes_per_second constant
oops I forgot to remove the log statement
@psvenk psvenk force-pushed the request-animation-frame-clock branch from 8f09ff9 to ef80a08 Compare October 26, 2020 16:33
last_interval does not need to be a global variable, so it, along with
the function redraw_clock_with_timestamp, has been moved into the
function scope of schedulesCallback. Furthermore, refreshes_per_second
was hard-coded (witha comment) and redundant calls to
requestAnimationFrame and redraw_clock were removed.
@psvenk psvenk merged commit de3a701 into Aspine:master Oct 26, 2020
@andOrlando andOrlando deleted the request-animation-frame-clock branch October 27, 2020 00:21
andOrlando added a commit that referenced this pull request Dec 16, 2020
Switches setInterval to requestAnimationFrame (closes #135).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clock render uses setInterval not requestAnimationFrame
2 participants