Short answer: your code would take 15 seconds to execute. Why?
There's no way to run parallel code in javascript. The only way to run synchronous code without blocking the event loop would be to spawn a Worker. Since the async module doesn't care about workers, it would have to wait for your functions to be done before it can call the next one.
Consider the following:
sleep(5)
sleep(5);
sleep(5);
Obviously it would take 15 seconds. Now even if you make this "parallel" the way async does:
function parallel () {
process.nextTick(function(){
sleep(5);
});
process.nextTick(function(){
sleep(5);
});
}
parallel();
console.log("this is called immediately");
process.nextTick(function(){
console.log("this is called 10 secs later");
});
The code is executed immediately, but as soon as the event loop yields to those queued up methods, they are gonna block other code from executing.