title: C# - Repeating a method call using timers
body: <p>In a VSTO add-in I'm developing, I need to execute a method with a specific delay. The tricky part is that the method may take anywhere from 0.1 sec to 1 sec to execute. I'm currently using a <code>System.Timers.Timer</code> like this:</p>
  
  <pre><code>    private Timer tmrRecalc = new Timer();
  
      // tmrRecalc.Interval = 500 milliseconds
  
      private void tmrRecalc_Elapsed(object sender, System.Timers.ElapsedEventArgs e){
  
          // stop the timer, do the task
          tmrRecalc.Stop();           
          Calc.recalcAll();
          
          // restart the timer to repeat after 500 ms
          tmrRecalc.Start();
      }
  </code></pre>
  
  <p>Which basically starts, raises 1 elapse event after which it is stopped for the arbitrary length task is executed. But the UI thread seems to hang up for 3-5 seconds between each task.</p>
  
  <p>Do Timers have a 'warm-up' time to start? Is that why it takes so long for its first (and last) elapse?</p>
  
  <p>Which type of timer do I use instead?</p>