, , , , , for. for, setTimeout(), , . :
function timeoutLoop(fn, startIndex, endIndex, delay) {
function doIteration() {
if (startIndex < endIndex){
fn(startIndex++);
setTimeout(doIteration, delay);
}
}
doIteration();
}
timeoutLoop(function(i) {
}, 0, 100, 0);
: http://jsfiddle.net/nnnnnn/LeZxM/1/
, , , , , , , chunkSize timeoutLoop(), , ( fn()) ..