By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,382 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

How to make application wait some time ?

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
BOOGIEMAN schrieb:
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

Nov 16 '05 #2

P: n/a
See the Thread.Sleep() method.
See the Console.Read() method.

--
Tim Wilson
..Net Compact Framework MVP

"BOOGIEMAN" <BO*********@YAHOO.COM> wrote in message
news:18******************************@40tude.net.. .
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

Nov 16 '05 #3

P: n/a
first question;use timer
for second,you can use hook
"BOOGIEMAN" <BO*********@YAHOO.COM> ????
news:18******************************@40tude.net.. .
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

Nov 16 '05 #4

P: n/a
As long as 'any key' is enter.

"Stefan L" <sl****@pp-software.REMOVEIfNoSpam.de> wrote in message
news:#Y**************@TK2MSFTNGP12.phx.gbl...
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
BOOGIEMAN schrieb:
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

Nov 16 '05 #5

P: n/a
On Wed, 9 Mar 2005 23:31:12 +0800, TianZhenjing wrote:
for second,you can use hook


I don't understand, what's hook ?
Can you post simple code example ?
Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.