473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to make application wait some time ?

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
5 50914
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yannick Turgeon | last post by:
Hello all, I've got a query which suddently became very slow. It now takes about 10 secs instead of 2 secs. I've got to identical DB (one is for test and the other is production). The query...
19
by: Frank Rizzo | last post by:
I want to log the user out when there has been a period of inactivity in the application. The key here is inactivity of the application, not the system. I know that you can retrieve the...
5
by: Alexander Inochkin | last post by:
Hello. I have a working ASP.NET service. I am using .NET Framework 1.1; IIS V6.0. (web garden not used) When I change web.config file or load new *.dll, my service restarts, and about 90...
4
by: Frank Walsh | last post by:
Hi, I'm experiencing a problem when my asp.net 1.1 application starts. It appears that when the application has not been used for 12 hours or so...I experience a much longer load time then if...
8
by: C.Joseph Drayton | last post by:
Hi All, I am calling a PHP script that does an operation then sends back a result. I want JavaScript to wait until that result has been recieved. I am using the following code. What can I do to...
4
by: EByker | last post by:
VBA for Excel contains the command Application.Wait ("time"). It does not however work in a Word application. Is there a similar command for VBA in Word? Thanks. Bertie
3
by: Peri | last post by:
Dear All, Can you please help me out in detecting the application idle time. I would like to lock the application if it is idle for more that 10 minutes. FYI - I have already tried...
1
by: Visu | last post by:
Hi All! How to find the application idle time in VB.NET windows application? We can get the windows Idle time Private Declare Function GetLastInputInfo Lib "user32.dll" But i want the...
1
by: justsam | last post by:
Hi Guys, can anybody help me to figure out how much sql server takes to process a query and in case application server is busy and due to that sql server is waiting to send the rsult to Application...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.