Groups | Blog | Home
all groups > vb.net > april 2005 >

vb.net : Imposing a delay in code execution



Marina
4/1/2005 2:02:42 PM
Use the Thread.Sleep method.

[quoted text, click to view]

Marty
4/1/2005 6:59:49 PM
Hi,

Is there a "light" way on CPU usage to delay a process in the code
execution. For example, if I want a function to wait 5 seconds before
continue executing without using a timer.

Is there a better way than using this:
While (MyCondition is true)
System.Windows.Forms.Application.DoEvents()
End While

Thanks,
Marty
4/1/2005 7:45:47 PM
Great,
that's really nice :)
Marty



[quoted text, click to view]
Herfried K. Wagner [MVP]
4/1/2005 9:32:01 PM
"Marty" <xmarty99@hotmail.com> schrieb:
[quoted text, click to view]

'System.Threading.Thread.Sleep(<number of milliseconds>)' will block the
currently executing thread.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
AddThis Social Bookmark Button