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 (X11; CrOS x86_64 14816.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Browser:
Chrome 103
Operating system:
Chrome OS 14816.64.0
Device Platform:
Desktop
Date tested:
2 years ago
FAST CEIL
3.1M/s
~~test
3.1M/s
Math.ceil(test)
880K/s
Math.floor(test)
879K/s
Math.floor(test) + 1 (CEIL)
875K/s
View exact numbers
Test name
Executions per second
✓
FAST CEIL
3,145,564 Ops/sec
~~test
3,145,414 Ops/sec
Math.ceil(test)
879,768 Ops/sec
Math.floor(test)
878,967 Ops/sec
Math.floor(test) + 1 (CEIL)
875,025 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