Originally posted by Xmas79
VB Code:
  1. Dim TimeNow As New DateTime()
  2.  
  3. TimeNow = Now
  4. While (Now.Subtract(TimeNow).Seconds < 10)
  5. 'Wait for timeout...Do nithing...
  6. End While
If you execute this on the same thread as the process you are waiting for then it probably wont be much better than sleep. You should at least have an Application.DoEvents in the loop. Better yet you can use a delegate or threading so that your application doesn't hang. If I'm wrong and it works fine then sorry