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/128.0.0.0 Safari/537.36 OPR/114.0.0.0
Browser:
Opera 114
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
floor
6.8M/s
trunc
6.8M/s
round
6.7M/s
parseFloat to int
2.5M/s
View exact numbers
Test name
Executions per second
✓
floor
6,825,592 Ops/sec
trunc
6,797,492 Ops/sec
round
6,669,322 Ops/sec
parseFloat to int
2,458,715 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())