[JS] Simple way to measure execution time
This sample shows count execution time for a function.
const test = () => {
let a = 0;
for (i = 0; i <= 100000; i++) {
a++;
}
}
console.time();
test();
console.timeEnd();
This sample shows count execution time for a function.
const test = () => {
let a = 0;
for (i = 0; i <= 100000; i++) {
a++;
}
}
console.time();
test();
console.timeEnd();
Comments