Delay

What command in C# make a delay in program (like Sleep() in C++)

Answer this question

Delay

  • paVF

    Thanks
  • Nagendran Sellaiah

    System.Threading.Thread.Sleep is pretty the same with WinAPI Sleep function.
  • AndersChen

    What are you trying to achieve with the Sleep

    Although, you can sleep the current thread via Thread.Sleep, doing this on the main thread is typically a bad thing as this will prevent Windows messages from being processed, and to the user it will seem like your application has locked up.

    If you are using this in a Windows Forms application, it is probably better to use a Timer class.



  • Delay