Testing a bug with Chrome (at least in macOS) where requestAnimationFrame
fires far faster than screen refresh rate when scrolling if another Stack Snippet is running.
I
I unfortunately can't make a min-repro outside of Stack Exchange, so here it is...
- Run the first snippet, check the logged values. On a 60Hz60 Hz monitor, they should be around 60FPS60 FPS everywhere.
- Start scrolling the main page. The values may start changing a bit (though normally only
min
should). - Run the second snippet and scroll back to the first one. See how
max
goes crazy out with numbers like 5,000 or 10,000FPS000 FPS (I believe the rounded value is due toperformance.now()
's min precision, thanks Spectre). Checking the rAF timestamp in these frames gives us a difference of0
: multiple callbacks did fire in a single frame).