Skip to content

Instantly share code, notes, and snippets.

@bprosnitz
Last active May 13, 2018 23:32
Show Gist options
  • Save bprosnitz/5f6158b11bbaaf07fae0 to your computer and use it in GitHub Desktop.
Save bprosnitz/5f6158b11bbaaf07fae0 to your computer and use it in GitHub Desktop.
Speed Up requestAnimationFrame - based Javascript Animation
var oldRequestAnimationFrame = window.requestAnimationFrame;
window.requestAnimationFrame = function(cb) {
var numExtra = 60;
oldRequestAnimationFrame(function(time) {
for (var i = 0; i < numExtra; i++) {
cb(time + 60*1000)
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment