473,804 Members | 4,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 50939
Hi Boogieman,

maybe you want to try this:
Sending a thread to sleep:
System.Threadin g.Thread.Sleep( 10000);

Waiting for a key to be pressed:
Console.WriteLi ne("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*********@YA HOO.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*********@YA HOO.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.REMOVE IfNoSpam.de> wrote in message
news:#Y******** ******@TK2MSFTN GP12.phx.gbl...
Hi Boogieman,

maybe you want to try this:
Sending a thread to sleep:
System.Threadin g.Thread.Sleep( 10000);

Waiting for a key to be pressed:
Console.WriteLi ne("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
7305
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 is slow only in production. When running this query in both DB and looking at execution plan, statistics, etc, the onle difference is the Cumulative wait time on server
19
46688
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 inactivity of the system via GetLastInputInfo. That's not what I want - I want inactivity of the application. Thanks.
5
1764
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 seconds two versions(instances) of my application exists. Is anybody know how to minimize the time between starting of the new version(instance) of application and the application end of previous
4
1628
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 the application was loaded recently. I attempted to do some research on the subject and found a few sites that talk about pre-compiling, which i attempted to do, however it doesn't look like this helps if your application is unloaded do to...
8
37737
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 stop it from generating a 'Too much recursion' error? function WaitForData() {
4
19244
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
7002
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 application.idle event. Thanks and Regards,
1
5750
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 idle time of my application alone in VB.NET.
1
2140
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 server even thougth sql server has finished to process query and how much that wait time is, in short here is what i'm looking total query time = sql server time + application time (or wait time) Thanks in Advance.
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.