Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
round vs trunc vs floor vs parseFloat
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 10; Mobile; rv:132.0) Gecko/132.0 Firefox/132.0
Browser:
Firefox Mobile 132
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
round
429.8M/s
trunc
428.0M/s
floor
426.7M/s
parseFloat to int
3.2M/s
View exact numbers
Test name
Executions per second
✓
round
429,753,760 Ops/sec
trunc
428,032,160 Ops/sec
floor
426,690,496 Ops/sec
parseFloat to int
3,191,476 Ops/sec
Tests:
trunc
Math.trunc(13.37) Math.trunc(13.67)
round
Math.round(13.37) Math.round(13.67)
floor
Math.floor(13.37) Math.floor(13.67)
parseFloat to int
parseFloat(12.17.toFixed()) parseFloat(12.97.toFixed())