How to make application wait some time ?

  • Thread starter Thread starter BOOGIEMAN
  • Start date Start date
B

BOOGIEMAN

I want to put my console application to wait some time
(for example 10 seconds) How do you do that ?
Also, how does "Press any key to continue" code look like in C# ?
If it helps, I can post here code example in Python
Thanks in advance
 
Hi Boogieman,

maybe you want to try this:


Sending a thread to sleep:
System.Threading.Thread.Sleep(10000);

Waiting for a key to be pressed:
Console.WriteLine("Press any key to continue...");
Console.Read();

HTH,
Stefan
 
As long as 'any key' is enter.

Stefan L said:
Hi Boogieman,

maybe you want to try this:


Sending a thread to sleep:
System.Threading.Thread.Sleep(10000);

Waiting for a key to be pressed:
Console.WriteLine("Press any key to continue...");
Console.Read();

HTH,
Stefan
 
Back
Top