I start the loop
function gameLoop(){ update(); draw(); requestAnimFrame(gameLoop); } var requestAnimFrame = window.requestAnimationFrame ||
Quite handy js library if you need to control Framrate in javascript https://github.com/aaronGoshine/Javascript-OnEnterFrame-Event-Manager/blob/master/index.html