Skip to content

Instantly share code, notes, and snippets.

@Ginden
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ginden/b88bf9e6f7742239f6fa to your computer and use it in GitHub Desktop.
Save Ginden/b88bf9e6f7742239f6fa to your computer and use it in GitHub Desktop.
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