Well im trying to "sleep" or make the program twiddle its thumbs for 15 seconds before continueing but without pausing the main thread.
So i thought maybe if i create a new thread and Sleep in that one that would help but no.
So then i thought the timer object but still no.
Now i dont know if the above "no"'s are because im completely stupid and cant use them or they didnt actually work.....
Heres the new thread method i stole from microsoft.
class Sleep
{
static TimeSpan waitTime = new TimeSpan(0, 0, 15);
public static void sSleep()
{
Thread newThread = new Thread(new ThreadStart(Sleeping));
newThread.Start();
if (newThread.Join(waitTime + waitTime))
{
//
}
else
{
//
}
}
static void Sleeping()
{
Thread.Sleep(waitTime);
}
}
That didnt work for me (it paused the main thread)
If someone could show me how to use the timer correctly that would be much appriciated.