miguelduarte42/Chip8JS — pull request #1 by d3x7r0 (2012-07-06 23:44:30+00:00)
Title: Use requestAnimationFrame instead of a setInterval to render on the screen

Made a simple change to use the brand new requestAnimationFrame API to draw on the screen instead of using a setInterval. A polyfill was added so it should work on browsers that don't support the feature though.

NOTE: apparently the API for request animation frame has changed and it no longer needs to be called from the update function to keep on drawing. Strangely the API keeps referencing the old behaviour so that's something to be on the lookout for.

The spec: http://webstuff.nfshost.com/anim-timing/Overview.html#requestAnimationFrame