我不知道。不过用Timer不知是否可以实现?

解决方案 »

  1.   

    Public Declare Function timeGetTime Lib "winmm.dll" () As Long
    Function BetterNow() As Date
             Dim UpTimeMsNew As Long
             Static OffSet As Date
             Static UpTimeMsOld As Long
             Const OneSecond = 1 / (24# * 60 * 60)
             Const OneMs = 1 / (24# * 60 * 60 * 1000)         UpTimeMsNew = timeGetTime()
             If OffSet = 0 Or UpTimeMsNew > 1000000000 Then
                OffSet = Date - UpTimeMsNew * OneMs + CDbl(Timer) * OneSecond
                UpTimeMsOld = UpTimeMsNew
                UpTimeMsNew = 0
             End If
             BetterNow = UpTimeMsNew * OneMs + OffSet
    End FunctionPublic Sub Pause(PauseLength As Long)
           Dim TimePrev As Date, TimeNow As Date, WaitTime As Date
           WaitTime = PauseLength / (24# * 60 * 60 * 1000)
           TimePrev = BetterNow()
           Do
               TimeNow = BetterNow()
               DoEvents
           Loop Until (TimeNow - TimePrev) > WaitTime
    End Sub
    输入:paues(1000)‘暂停一秒
      

  2.   

    再请教一下sleep函数的用法?谢了!
      

  3.   

    声明Sleep后,用Sleep(1000)就行了!