
function process( arr, step, end, index ){
var startTime = + new Date;
var len = arr.length;
index = index || 0;
while( + new Date - startTime < 30 ){
if( index == len ){
end && end();
return;
}
step && step( index, arr[ index ] );
index++;
}
var callee = arguments.callee;
setTimeout(function(){
callee( arr, step, end, index );
}, 0);
}




近期评论