4 ms·
I thought requestAnimationFrame was preferred instead of setTimeout? Or is there no advantage in a simple animation like this one?
by gkfasdfasdf 4y ago
I thought requestAnimationFrame was preferred instead of setTimeout? Or is there no advantage in a simple animation like this one?
- sigmoid10 4y agorequestAnimationFrame has a whole bunch of advantages, but you don't technically need it if you don't care about smoothness or efficiency or battery life or users browsing in other tabs or scrolling away. For something so simple, the impact will be minimal.