Home All Groups Group Topic Archive Search About
Author
13 Feb 2006 4:03 PM
raulavi
what should be used?
In a normal procedure (no thread) I would like to wait (do nothing) for few
secs.

I used a loop with with a clock , sleep and some thing else.

my concern is not to eat the cpu time. what shoul I use?

I see some thread.sleep, but will this work on a normal procedure?
shall I consider  a procedure as a thread ? or are there any differences ?

Author
13 Feb 2006 4:09 PM
Armin Zingler
"raulavi" <raul***@discussions.microsoft.com> schrieb
> what should be used?
> In a normal procedure (no thread) I would like to wait (do nothing)
> for few
> secs.
>
> I used a loop with with a clock , sleep and some thing else.
>
> my concern is not to eat the cpu time. what shoul I use?
>
> I see some thread.sleep, but will this work on a normal procedure?
> shall I consider  a procedure as a thread ? or are there any
> differences ?

A thread executes code. Your procedure belongs to that code. Use
Thread.Sleep to have the thread sleep.


Armin
Author
13 Feb 2006 4:11 PM
AMercer
> what should be used?
> In a normal procedure (no thread) I would like to wait (do nothing) for few
> secs.
> my concern is not to eat the cpu time. what shoul I use?

Use System.Threading.Thread.Sleep(Milliseconds).
Author
13 Feb 2006 4:12 PM
Andrew Morton
raulavi wrote:
> what should be used?
> In a normal procedure (no thread) I would like to wait (do nothing)
> for few secs.
>
> I see some thread.sleep, but will this work on a normal procedure?

Yes, and yes.

Andrew
Author
13 Feb 2006 9:18 PM
CMM
If this helps to put it into perspective:

System.Threading.Thread.Sleep(...)
does the same thing AFAIK:
System.Threading.Thread.CurrentThread.Sleep(...)

--
-C. Moya
www.cmoya.com
Show quoteHide quote
"Andrew Morton" <a**@in-press.co.uk.invalid> wrote in message
news:%23Lh4phLMGHA.524@TK2MSFTNGP09.phx.gbl...
> raulavi wrote:
>> what should be used?
>> In a normal procedure (no thread) I would like to wait (do nothing)
>> for few secs.
>>
>> I see some thread.sleep, but will this work on a normal procedure?
>
> Yes, and yes.
>
> Andrew
>