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; rv:124.0) Gecko/20100101 Firefox/124.0
Browser:
Firefox 124
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
floor
1239.7M/s
round
1232.6M/s
trunc
1230.3M/s
parseFloat to int
9.3M/s
View exact numbers
Test name
Executions per second
✓
floor
1,239,682,688 Ops/sec
round
1,232,593,408 Ops/sec
trunc
1,230,296,704 Ops/sec
parseFloat to int
9,277,228 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())