title: Incorrect elapse time for System.Timers.Timer
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5265259/system-timer-elapsed-event-seems-to-fire-late-for-short-intervals-in-net">System.Timer elapsed event seems to fire late for short intervals in .Net</a>  </p>
  </blockquote>
  
  
  
  <p>I use System.Timers.Timer in my windows service. Interval set to 60000 ms, but every next elapse, timer interval increases on some ms..Here example of log:</p>
  
  <pre><code>2011-09-05 00:00:37,177 [80] INFO - 
  timer_Elapsed;
  
  2011-09-05 00:01:37,187 [8] INFO  - 
  timer_Elapsed;
  
  2011-09-05 01:24:38,279 [71] INFO   - 
  timer_Elapsed;
  </code></pre>
  
  <p>But I need to elapse timer in 37 seconds, as example, but after work some time, we have elapse timer in 38, 39, 40 .. sec..</p>
  
  <p>I don't need very precision timer, but i need to elapse 37 +- 1sec every time..</p>
  
  <p>How i can resolve this problem???</p>
  
  <hr>
  
  <p>I one time set Interval property in:</p>
  
  <pre><code>protected override void OnStart(string[] args)
  {
     log4net.Config.XmlConfigurator.Configure();
     EmailReminderService.Logger.Info("Service started");
  
     _timer.Interval =Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
     _timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     _timer.Enabled = true;               
  }
  
  private void timer_Elapsed(object source, System.Timers.ElapsedEventArgs e)
  {
     EmailReminderService.Logger.Info("timer_Elapsed;");
     EmailReminderManager manager = new EmailReminderManager();
     manager.EmailReminderProcessing();
  }
  </code></pre>
  
  <p>In timer elapsed method not use _timer object..</p>