Power consumption - Energia Launchpad
Assuming its not optimized, Example A loops flag = 1. Example B on the other hand, toggles every time. Flag = 0, Then Flag = 1, repeat. Based on that, Example B will have more instructions, as it takes the value of flag, inverts it and updates flag. More instructions, more processing time, more power. But since your entire code is a loop without any low-power mode, they will take the same amount of power. Example B just takes a little bit longer, but we are talking fractions of a second.