I want to override async.waterfall()
(or write timed_waterfall()
) so that it prints execution time for each step. How to do that?
async.waterfall([
f=>{
console.log('step1');
f();
},
f=>{
console.log('step2');
f();
},
f=>{
console.log('step3');
f();
},
],
()=>{
console.log('done');
})
Desired output:
step1
1ms
step2
2ms
step3
1ms
done
5ms
Compatible with async.js
waterfall()
:It's easy t modify to print the totals as well.