Last active
August 29, 2015 14:05
-
-
Save Ginden/b88bf9e6f7742239f6fa to your computer and use it in GitHub Desktop.
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 bigArray = createBigArray(500000); | |
var maxPerTick = 200; | |
setTimeout(function notWow() { | |
var n = maxPerTick; | |
var el; | |
var currIndex = bigArray.length; | |
while (bigArray.length && n--) { | |
el = bigArray[currIndex--]; | |
process(el); | |
} | |
bigArray.length = currIndex; | |
setTimeout(notWow, 100); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment