Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
console.time overhead confirmed
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
without console.time
2501625.8 Ops/sec
with console.time
77904.0 Ops/sec
Script Preparation code:
function factorial (num) { if (num < 0) { throw new Error("Number cannot be negative."); } if (num % 1 !== 0) { throw new Error("Number must be an integer."); } // The base case if (num === 0 || num === 1) { return 1; } // The general case return num * factorial(num - 1); }
Tests:
without console.time
factorial(20);
with console.time
console.time('factorial'); factorial(20); console.timeEnd('factorial');