Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
bool to int
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
ternary
1108658304.0 Ops/sec
or operator
1032713792.0 Ops/sec
unary + operator
1065155904.0 Ops/sec
Number
13453378.0 Ops/sec
Script Preparation code:
const bool_t = true; const bool_f = false;
Tests:
ternary
true === true ? 1:0; false === true ? 1:0;
or operator
true | 0; false | 0;
unary + operator
+true +false
Number
Number(true); Number(false);