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
Test name
Executions per second
trunc
10067463.0 Ops/sec
round
9707678.0 Ops/sec
floor
9218248.0 Ops/sec
parseFloat to int
4260608.5 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())