title: C# time delay on application
body: <p>I am currently developing an application, I would like to implement a time delay. I don't want to use System.Threading.Thread.Sleep(x); as I read this stalls the thread (UI freezes)</p>
  
  <p>The code I have currently written is:</p>
  
  <pre><code>public void atimerdelay()
  {
      lblStat.Text = "In the timer";
      System.Timers.Timer timedelay;
      timedelay = new System.Timers.Timer(5000);
      timedelay.Enabled = true;
      timedelay.Start();
  }
  </code></pre>
  
  <p>I know atimerdelay() does get called (using lblStat), but their is no delay of 5 seconds. I have read <a href="http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx</a> but I can't work out why the above code is not working.</p>
  
  <p>Additional information - (added for Hamlet Hakobyan)</p>
  
  <p>The application is a 'card checker' application (University project - no real information is used or stored). Once the user has filled out all the relevant and click 'check' a list of validation methods are called. Before any of these are called a ping is carried out to make sure a live internet connection is on the computer. I want to add a slight delay between the ping and the starting of the validation. </p>