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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
FAST CEIL
32.9M/s
~~test
31.6M/s
Math.floor(test)
11.8M/s
Math.floor(test) + 1 (CEIL)
11.5M/s
Math.ceil(test)
10.8M/s
View exact numbers
Test name
Executions per second
✓
FAST CEIL
32,917,378 Ops/sec
~~test
31,558,390 Ops/sec
Math.floor(test)
11,806,645 Ops/sec
Math.floor(test) + 1 (CEIL)
11,456,014 Ops/sec
Math.ceil(test)
10,791,643 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