This is an example:
function func1() { setTimeout(function(){doSomething();}, 3000); } for(i=0;i<10;i++) { func1(); }
after executing
With async.js:
async.timesSeries(5, function (n, next) { setTimeout(function(){ doSomething(); next(); }, 3000); });