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 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 131
Operating system:
iOS 18.1.1
Device Platform:
Mobile
Date tested:
one year ago
trunc
10.1M/s
round
9.7M/s
floor
9.2M/s
parseFloat to int
4.3M/s
View exact numbers
Test name
Executions per second
✓
trunc
10,067,463 Ops/sec
round
9,707,678 Ops/sec
floor
9,218,248 Ops/sec
parseFloat to int
4,260,608 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())