« Read a Text File and Add text to a Textbox Control With Stream Reader Class - VB.NET | Home | Add ‘all’ Date/Time Formats to Listbox/Combobox - .NET »
Time/Pause for the Specified Time
By Jason | June 17, 2007
'This will pause or timeout your applications code for the specified amount of milli-seconds.
'Declare a new DateTime variable and fill it with the current'time with 2000 milli-seconds added to it.
Dim timeOut As DateTime = Now.AddMilliseconds(2000)
Do
'Keep the app from freezing and allow Windows to continue processing the applications messages.
Application.DoEvents()
'Keep looping until the elasped time of 2000 milliseconds.
Loop Until Now > timeOut
MsgBox("The code paused for: 2000 Milli-Seconds or 2 Seconds!")
Popularity: 7% [?]
Topics: - (.NET All + 05/08) |

