+ 22
How to get the frame rate (fps) at the time of animation?
So, I was just trying to make something magical but I'm stuck in between... [Repeat] How do we get the fps rate at the time of animation with a time interval of every 1 second? Is it with requestAnimationFrame or something else?
3 ответов
+ 5
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
http://codetheory.in/controlling-the-frame-rate-with-requestanimationframe/
Maybe tbis could help you? I don't know any javascript :D
+ 17
@Gami, @Aloisia
Thanks... ^^
+ 12
setInterval(whateverFunction(), 1000) for 1 second
If you want to keep it at the browser's fps, you would need to do this
function whateverFunction() {
requestAnimationFrame(whateverFunction)
}
whateverFunction()