How To measure Execution time in Node?

To measure execution time in Node you can go with below code. IF you still face any issue or help feel free to connect with us.

Use console.time() and console.timeEnd()

let i;
let a;
console.time("yourVariable");

for(i = 1; i < 1000000; i++){
    a+=1;
}

console.timeEnd("yourVariable");

Leave a Reply

Your email address will not be published. Required fields are marked *