Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
log10 vs string len
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
log10
87540200.0 Ops/sec
string len
1484958464.0 Ops/sec
Script Preparation code:
var a = 123456; var b = 1; var c = 123456.0132456; var d = 1
Tests:
log10
Math.floor(Math.log10(a)); Math.floor(Math.log10(b)); Math.floor(Math.log10(c)); Math.floor(Math.log10(d));
string len
a.toString().length; b.toString().length; c.toString().length; d.toString().length;