Also, is it possible to detect which line is taking more time to execute?
After a week research on Javascript performance, I found Google Devtools to be the best to calculate each performance time of javascript and rendering HTML structure.
solution goes here:
var start = +new Date();
callYourFunctionHere();
var end = +new Date();
var time = end - start;
console.log('total execution time = '+ time + 'ms');
Solution goes here:
var start = +new Date();
callYourFunctionHere();
var end = +new Date();
var time = end - start;
console.log('total execution time = '+ time + 'ms');
Alok Deshwal
Node.js Developer | AWS guru
Dharmaraj P.S "Also, is it possible to detect which line is taking more time to execute?" in that case you just need to put this code exact where you are doing I/O. That's it.