Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math.ceil vs floor vs ~~
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 16
Operating system:
iOS 16.6
Device Platform:
Mobile
Date tested:
2 years ago
~~test
18.4M/s
FAST CEIL
18.1M/s
Math.ceil(test)
7.4M/s
Math.floor(test) + 1 (CEIL)
7.2M/s
Math.floor(test)
7.1M/s
View exact numbers
Test name
Executions per second
✓
~~test
18,396,800 Ops/sec
FAST CEIL
18,124,190 Ops/sec
Math.ceil(test)
7,396,332 Ops/sec
Math.floor(test) + 1 (CEIL)
7,229,132 Ops/sec
Math.floor(test)
7,058,273 Ops/sec
Script Preparation code:
var test = 190.4;
Tests:
Math.ceil(test)
Math.ceil(test)
~~test
~~test
Math.floor(test)
Math.floor(test)
Math.floor(test) + 1 (CEIL)
Math.floor(test) + 1
FAST CEIL
~~test + 1