How to determine the best "framerate" (setInterval delay) to use in a JavaScript animation loop?

Posted by Ricket on Stack Overflow See other posts from Stack Overflow or by Ricket
Published on 2010-05-30T19:53:20Z Indexed on 2010/05/30 20:22 UTC
Read the original article Hit count: 181

Filed under:
|

When writing a JavaScript animation, you of course make a loop using setInterval (or repeated setTimeout). But what is the best delay to use in the setInterval/setTimeout call(s)?

In the jQuery API page for the .animate() function, the user "fbogner" says:

Just if anyone is interested: Animations are "rendered" using a setInterval with a time out of 13ms. This is quite fast! Chrome's fastest possible interval is about 10ms. All other browsers "sample" at about 20-30ms.

Any idea how jQuery determined to use this specific number?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery