I'm using requestAnimationFrame
to handle my frame rate in a WebGL game, and running through the Chrome profile shows that a solid 10% of the time is spent in (idle)
. Why is that? How can I reduce this time, that, unless I'm misunderstanding, is just wasted?
I'm using raw WebGL. Here's part of my rendering code:
Animator.prototype.tick = function() {
window.requestAnimationFrame(util.bind(this.tick, this));
if (this.paused) return;
this.advanceWorld();
this.drawScene();
};
Full code at: https://github.com/nickgeorge/quantum/blob/master/animator.js