Cleaning up alternating code
<p>I have this function that about the following</p>

<pre><code>bool flag = true;
while(true){
    if(flag){
      function1();
    }else{
      function2();
    }
    flag = !flag;
}
</code></pre>

<p>I'm looking at it and it doesn't really seem that clean. I just want to alternate between those 2 functions. Is there a way to make this a bit more cleaner and more readable or would you just keep it this way? Because now I'm having like 5 rows of code that seems a bit messy.</p>

<p>PS: <em>The <code>while(true)</code> isn't actually part of the code, just a demonstration that it's going on for some time.</em></p>
