Quantcast
Viewing latest article 1
Browse Latest Browse All 10

Answer by Mike Dunlavey for Two if conditions or one if with OR

Assuming each cond is about equally likely to be true as false, and assuming each cond takes one STU (significant time unit) then half the time the || will take 1 STU and half the time 2 STU, for overall expectation of 1.5 STU instead of 2.

If STU is a nanosecond, it probably doesn't matter.

If STU is a century, it probably does.


Viewing latest article 1
Browse Latest Browse All 10

Trending Articles