title: Better way to handle timing related action
body: <p>How can I write in a better way(in terms of coding styles, or more advanced level of programming ) this:</p>
  <pre><code>void main() {
    static int count = 0;    
    while (1) {
      count++;
      if (count % 4 == 0) {
        doThis();
        count = 0;
      } else {
        doThat();
      }
    }
  }
  </code></pre>
  <p>This of course works correclty but it seems a little bit a kind of &quot;noob&quot; coding :)</p>