title: Does usage of Thread.Sleep(n) causes performance issues?
body: <p>I am using Thread.Sleep(n) for my project. I heard that Thread.Sleep can cause performance issues but not sure about it. </p>
  
  <p>My requirement is:</p>
  
  <blockquote>
    <p>Wait for 5 minute increments, up to 30 minutes (6 times the 5 minute
    delay).  After this, begin to increment by 1 hour and do this 5 times
    (additional 5 hours).</p>
  </blockquote>
  
  <p>Below I have provided my sample code which uses Thread.Sleep(n) in different scenarios:</p>
  
  <pre><code>Thread.Sleep(1000 * 60 * 5); //-------waiting for 5 minutes
  var isDownloaded = false;
  try
  {
      var attempt = 0;
      while (attempt &lt; 11)
      {
          isDownloaded = TryDownloading(strPathToDownload, strFileToDownload);
          if (isDownloaded)
              break;
          attempt++;
          if (attempt &lt; 6)
              Thread.Sleep(1000 * 60 * 5); //--------waiting for 5 minutes
          else
          {
              if (attempt &lt; 11)
                  Thread.Sleep(1000 * 60 * 60); //-------waiting for 1 hour
              else
                  break;
          }
      }
  
  }
  </code></pre>
  
  <p>On the above code I am trying to download a file with a maximum of 11 download attempts. Initially it waits for 5 minutes and then try to download the file which is the <em>first attempt</em> and if failed then it tries for the <strong>next 5 attempts with an interval of 5 minutes each</strong>. If they failed for the first six attempts then it go for the <strong>next 5 attempts with an interval for 1 hour each</strong>. </p>
  
  <p>So we decided to use Thread.Sleep for those time delay in our console app.</p>
  
  <p>Does this causes any problem or performance issues?</p>
  
  <p>If Thread.Sleep(n) causes performance issues, then which would be an better alternative way instead of using Thread.Sleep(n)?</p>
  
  <p>Also finally, Does MSDN suggested that Thread.Sleep(n) is harmful or it shouldn't be used?</p>