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 name
Executions per second
Math.ceil(test)
7396332.5 Ops/sec
~~test
18396800.0 Ops/sec
Math.floor(test)
7058273.0 Ops/sec
Math.floor(test) + 1 (CEIL)
7229131.5 Ops/sec
FAST CEIL
18124190.0 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