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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
round
7.6M/s
trunc
7.6M/s
floor
7.5M/s
parseFloat to int
3.0M/s
View exact numbers
Test name
Executions per second
✓
round
7,588,800 Ops/sec
trunc
7,588,318 Ops/sec
floor
7,543,498 Ops/sec
parseFloat to int
2,985,594 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())