Request animation frame (RAF), is currently the best way to control animation. It respects the browser's resources and everything stops when a tab is in the background. Great news for mobile batteries!
You can't set the frames per second (fps), which defaults to about 60fps.
A check for elapsed time within the RAF loop allows finer control, which is what we see above.
Tested down to IE7.
A high resolution timing method is possible for recent browsers only using performance.now().
Interesting explaination of this method can be found here:
When milliseconds are not enough: performance.now
And this is a demo of throttling using performance.now().