delay time visual basic


SUBMITTED BY: vishaldagar

DATE: July 9, 2017, 5:19 p.m.

FORMAT: Text only

SIZE: 301 Bytes

HITS: 1071

  1. Sub Delay(ByVal dblSecs As Double)
  2. Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
  3. Dim dblWaitTil As Date
  4. Now.AddSeconds(OneSec)
  5. dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
  6. Do Until Now > dblWaitTil
  7. Application.DoEvents() ' Allow windows messages to be processed
  8. Loop
  9. End Sub

comments powered by Disqus