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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Browser:
Chrome 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
FAST CEIL
12.5M/s
~~test
12.4M/s
Math.ceil(test)
4.6M/s
Math.floor(test) + 1 (CEIL)
4.6M/s
Math.floor(test)
4.6M/s
View exact numbers
Test name
Executions per second
✓
FAST CEIL
12,482,815 Ops/sec
~~test
12,351,172 Ops/sec
Math.ceil(test)
4,638,084 Ops/sec
Math.floor(test) + 1 (CEIL)
4,629,012 Ops/sec
Math.floor(test)
4,628,128 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