aboutsummaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-10-26 10:05:04 +0100
committerBen Harris <bjh21@bjh21.me.uk>2022-11-09 21:40:27 +0000
commit7982002a644328164bf0f77bf489876ad012e90d (patch)
tree496e54d8dc6e6bd2c0fcd08f8f9a377c1021f830 /html
parentc5a2446fae603a480de58b912fa349549bd9f247 (diff)
downloadpuzzles-7982002a644328164bf0f77bf489876ad012e90d.zip
puzzles-7982002a644328164bf0f77bf489876ad012e90d.tar.gz
puzzles-7982002a644328164bf0f77bf489876ad012e90d.tar.bz2
puzzles-7982002a644328164bf0f77bf489876ad012e90d.tar.xz
js: Switch to window.requestAnimationFrame() for timing
This is an API specifically designed for the purposes of timing animations. Unlike setInterval, it tries to synchronise with the screen refresh rate. It naturally passes us timing information, saving the need to construct a Date object every frame. It has the nice feature that browsers (at least Firefox 91) will call it less frequently when the puzzle page isn't visible, which saves CPU time in puzzles that run a timer continuously.
Diffstat (limited to 'html')
0 files changed, 0 insertions, 0 deletions