Last active
May 13, 2018 23:32
-
-
Save bprosnitz/5f6158b11bbaaf07fae0 to your computer and use it in GitHub Desktop.
Speed Up requestAnimationFrame - based Javascript Animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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