title: condition to do something only once every x number of loops
body: <p>I can't figure this out so maybe someone here can help me. I have a function with one argument and inside that function there's code I want to run every x number of times.</p>
  
  <pre><code>void doSomething(int _arg){
      // do something every 250 times
  }
  </code></pre>
  
  <p>The function is called repeatedly but the argument isn't augmented by 1. So for example the function calls might look like this and I want a condition inside the function to be run every 250 times.</p>
  
  <pre><code>doSomething(1); // do something
  doSomething(130);
  doSomething(230);
  doSomething(310); // 250 was passed, do something
  doSomething(420);
  doSomething(570); // 2*250 was passed, do something
  </code></pre>
  
  <p>I can't just do something like <code>if(_arg % 250 == 0)</code> because the value of <code>_arg</code> is irregular (but the intervals are always smaller than 250).</p>