if (TimeDelay(5000)) { //5 seconds
//5 seconds is up
}
public static bool TimeDelay(int intDelayInMilliSeconds)
{
Thread.Sleep(intDelayInMilliSeconds);
return true;
}
you will have to use System.Threading
using System.Threading;
if (a different statement is true)
{
//do not run through function for 5 seconds
if (TimeDelay(5000)) { //5 seconds
/*5 seconds is up and we are out of the if statement nothing has been done, all that happened is it stayed in TimeDelay for 5 seconds
*/
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.