title: Compare using Thread.Sleep and Timer for delayed execution
body: <p>I have a method which should be delayed running for a specified amount of time.</p>
  
  <p>Should I use</p>
  
  <pre><code>Thread thread = new Thread(() =&gt; {
      Thread.Sleep(millisecond);
      action();
  });
  thread.IsBackground = true;
  thread.Start();
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>Timer timer = new Timer(o =&gt; action(), null, millisecond, -1);
  </code></pre>
  
  <p>I had read some <a href="http://msmvps.com/blogs/peterritchie/archive/2007/04/26/thread-sleep-is-a-sign-of-a-poorly-designed-program.aspx" rel="noreferrer">articles</a> about using <code>Thread.Sleep</code> is bad design. But I don't really understand why.</p>
  
  <p>But for using Timer, Timer has dispose method. Since the execution is delayed, I don't know how to dispose Timer. Do you have any suggestions?</p>
  
  <p>Or if you have alternative codes for delayed execution are also appreciate.</p>