473,387 Members | 1,575 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,387 software developers and data experts.

wait a few seconds before next statement

Hi,

I'm looking for a way to have my app wait a few seconds before performing
the next statement.
I've tried Thread.Sleep(), but that makes my app non-responsive sometimes.
Is there another way to do this?

Thanks
Nov 15 '05 #1
3 2042
For a definate period of time. Sleep is the only way to do this but it
blocks the thread as you seen. Why not put the operations into a thread you
want to do at a set pace then use sleep there, that way youre application
will not be unrepsonsive.


"dawn" <da******@hotmail.com> wrote in message
news:nE**********************@phobos.telenet-ops.be...
Hi,

I'm looking for a way to have my app wait a few seconds before performing
the next statement.
I've tried Thread.Sleep(), but that makes my app non-responsive sometimes.
Is there another way to do this?

Thanks

Nov 15 '05 #2
Maybe you could use the IAsyncResult interface along with Thread.Sleep?

"dawn" <da******@hotmail.com> wrote in message
news:nE**********************@phobos.telenet-ops.be...
Hi,

I'm looking for a way to have my app wait a few seconds before performing
the next statement.
I've tried Thread.Sleep(), but that makes my app non-responsive sometimes.
Is there another way to do this?

Thanks

Nov 15 '05 #3
Taylor Monacelli wrote:
Maybe you could use the IAsyncResult interface along with Thread.Sleep?

"dawn" <da******@hotmail.com> wrote in message
news:nE**********************@phobos.telenet-ops.be...
Hi,

I'm looking for a way to have my app wait a few seconds before performing
the next statement.
I've tried Thread.Sleep(), but that makes my app non-responsive sometimes.
Is there another way to do this?

Thanks



Maybe you mean to use Asynchronous Delegates?
"dawn", please, read about it in MSDN. I want to mention that you should
call Thread.Sleep() in the fuction you are calling and not in the
calling code.

Dmirty.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: BOOGIEMAN | last post by:
I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to...
5
by: Erwin Kloibhofer | last post by:
what if i have a webpage that displays the text "please wait, this may take a few seconds..." and it now waits until some event on the server happens. whatever this is, this can be quick, but it...
4
by: MLH | last post by:
Best way to make Access 2.0 code wait 10 seconds before processing the next line??? For i=1 to whatever : next i is just too processor intensive. Isn't there something less taxing I can...
15
by: Snuyt | last post by:
Hello, I want the program to wait a few seconds between executing code. It should look something like this: public sub xx() ...code... wait(2) 'wait 2 seconds ...code...
11
by: ryan | last post by:
Hi, I've omitted a large chunk of the code for clarity but the loop below is how I'm calling a delegate function asynchronously. After I start the each call I'm incrementing a counter and then...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
4
by: MrDeej | last post by:
Hello guys! I am trying to use trevors wait function on my odbc database for a countdown function. But this function is not stable as it sometimes dosent actually wait before launching next line...
1
by: meihome | last post by:
I have a pretty long process (40 seconds) script. It is kicked off from one controller action from web browser. The problem is, the Rails does not wait until the process is done. It actually...
5
by: Tony WONG | last post by:
i have a "for next" program to detect workstations ON/OFF status by ping. i wish the program restart after 60 seconds after completion of for next loop. at present, i use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.