• Recent Posts

  • Meta

  • Tags

    autocomplete benchmark data cpu cycles directory exists disable beep on enter doevents ebook excel extensions file exists getinputstate gzip high cpu usage intensive task left edge linq mcisendstring microsoft msdn no doevents office open webpage play mp3 play wave right edge scroll textbox shell show icon show notify icon source stop beep on enter system tray text tar textbox text in system tray time consuming tutorials vb 2008 video visual basic.net visual basic 2005 visual studio visual studio 2005 ehancements vs 2005 IDE extensions windows mci
  • « 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

    Click Star to Rate Post
    1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5 out of 5)
    Loading ... Loading ...


       
    Bookmark and Share

     


     
    '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) |

    Comments