Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Bitwise flags checking
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/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Checking with > 0 when set
221069504.0 Ops/sec
Checking with === when set
210715024.0 Ops/sec
Checking with > 0 when not set
224648592.0 Ops/sec
Checking with === when not set
207090784.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const FLAG = 2; const setValue = FLAG; const unsetValue = 8;
Tests:
Checking with > 0 when set
const isSet = (setValue & FLAG) > 0
Checking with === when set
const value = FLAG; const isSet = (setValue & FLAG) === FLAG
Checking with > 0 when not set
const isSet = (unsetValue & FLAG) > 0
Checking with === when not set
const isSet = (unsetValue & FLAG) === FLAG