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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
trunc
3.3M/s
round
3.2M/s
floor
3.1M/s
parseFloat to int
1.3M/s
View exact numbers
Test name
Executions per second
✓
trunc
3,275,154 Ops/sec
round
3,242,576 Ops/sec
floor
3,097,002 Ops/sec
parseFloat to int
1,254,454 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())