Search Tools Links Login

Time Delay Function

It is method that delay time as much as time that designate.
There is no problem even if use over midnight.
With Sleep function, use and lowered CPU's use rate.

Original Author: SeonJong,CHOI

API Declarations

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Public Sub Delay(ByVal delayTime As Single)
  Dim startTime  As Single
  Dim LoopTime  As Single
  startTime = Timer
    Call Sleep(50)
    If Timer < startTime Then startTime = startTime - 86400
    LoopTime = Timer - startTime
  Loop Until delayTime < LoopTime
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 75 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.