Author Topic: Sleep function in C# - Thread.Sleep  (Read 2831 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Sleep function in C# - Thread.Sleep
« on: December 01, 2011, 06:40:01 pm »
To wait in a function or a thread, you can use Thread.Sleep by passing the milliseconds.

Code: (C#)
//Source Code Listing


// The following line would wait for one minute = 60 seconds = 60 * 1000 milliseconds;

Thread.Sleep(1000 * 60 * 1);


// The following line would wait 5 minutes

Thread.Sleep(1000 * 60 * 5);


 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1