|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
sleep or delaywhat 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 ? "raulavi" <raul***@discussions.microsoft.com> schrieb A thread executes code. Your procedure belongs to that code. Use > 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 ? Thread.Sleep to have the thread sleep. Armin > what should be used? Use System.Threading.Thread.Sleep(Milliseconds).> 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? raulavi wrote:
> what should be used? Yes, and yes.> 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? Andrew If this helps to put it into perspective:
System.Threading.Thread.Sleep(...) does the same thing AFAIK: System.Threading.Thread.CurrentThread.Sleep(...) 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 >
filesystem.getfiles question
BackGroundWorker.ProgressChanged "Cross-thread operation not valid" at 2nd/3th/... progress datagrid entry with no db components control disable byref and byvalue sleep? VS2005 Buiild Options Looking for graphic controls to use in .NET compiles as a form -- but not as a control Start Process |
|||||||||||||||||||||||