So, two cases:
Case1:
if (doSomething) doFunction(); //... void doFunction() { // ... do something time consuming } Case 2:
doFunction(); //... void doFunction() { if (!doSomething) return; // ... do something time consuming } This is within extremely time sensitive environment (roughly 0.1 ms would make a big difference); doFunction() is called quite often (order of ~100 times) and most often than not, doSomething is false. It seems obvious that case 1 would be more efficient, but by how much? Or would it not make a difference (on the order of 0.01 ms)?