title: System.Threading.Timer in C# it seems to be not working. It runs very fast every 3 second
body: <p>I've a timer object. I want it to be run every minute. Specifically, it should run a <code>OnCallBack</code> method and gets inactive while a <code>OnCallBack</code> method is running. Once a <code>OnCallBack</code> method finishes, it (a <code>OnCallBack</code>) restarts a timer.</p>
  
  <p>Here is what I have right now:</p>
  
  <pre><code>private static Timer timer;
  
  private static void Main()
  {
      timer = new Timer(_ =&gt; OnCallBack(), null, 0, 1000 * 10); //every 10 seconds
      Console.ReadLine();
  }
  
  private static void OnCallBack()
  {
      timer.Change(Timeout.Infinite, Timeout.Infinite); //stops the timer
      Thread.Sleep(3000); //doing some long operation
      timer.Change(0, 1000 * 10);  //restarts the timer
  }
  </code></pre>
  
  <p>However, it seems to be not working. It runs very fast every 3 second. Even when if raise a period (1000*10). It seems like it turns a blind eye to <code>1000 * 10</code></p>
  
  <p>What did I do wrong?</p>