Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function splitLoop(items, process, context, callback) {
- var todo = items.concat();
- setTimeout(function () {
- var start = +new Date();
- do { process.call(context, todo.shift());
- }
- while (todo.length > 0);
- if (todo.length > 0) {
- setTimeout(arguments.callee, 25);
- } else {
- callback(items);
- }
- }, 25);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement