# Re: 帮我吧...

Posted by Vincent on January 11, 1999 at 20:11:43:

In Reply to: 帮我吧... posted by Chie on December 04, 1998 at 22:47:20:

: 我希望程式能隔一段时间例如五秒ㄚ,一行完后再等五秒后执行
: 大概重复10几次吧,如果用Timer好像需要很多个
: 除此之外不知还有什么好办法吗??
: 请赐教....!!!
用 API GetTickCount
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub Wait(iSec As Integer)
Dim iStart As Long
Dim i As Long

iStart = GetTickCount
Print iStart
Do Until i - iStart > iSec
i = GetTickCount
Loop
Print i
End Sub

Private Sub Command1_Click()
Wait 3000
End Sub

Follow Ups: