Of course, instead of while(true) loop, you have requestAnimationFrame callbacks. Calculate time difference and you know exactly how much further to move your state. I'm coding with Haxe using Flambe so I can't give you js code, but essentially: 1. You calculate time diff since last RAF callback (from given timestamp) 2. Add that difference to accumulator 3. while(accumulator >= STEP_TIME) {accumulator-= STEP_TIME; updateLogic();}//step time being your target fps.. 1/60, 1/30... 4. setInterpo