请说明每行的意思 Public Declare Function GetTickCount Lib "kernel32" () As LongSub delay(dt As Long)Dim t As Longt = GetTickCountDoDoEventsLoop Until GetTickCount - t > dtEnd Sub

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 17:41:03
请说明每行的意思PublicDeclareFunctionGetTickCountLib"kernel32"()AsLongSubdelay(dtAsLong)DimtAsLongt=GetTickC

请说明每行的意思 Public Declare Function GetTickCount Lib "kernel32" () As LongSub delay(dt As Long)Dim t As Longt = GetTickCountDoDoEventsLoop Until GetTickCount - t > dtEnd Sub
请说明每行的意思 Public Declare Function GetTickCount Lib "kernel32" () As Long
Sub delay(dt As Long)
Dim t As Long
t = GetTickCount
Do
DoEvents
Loop Until GetTickCount - t > dt
End Sub

请说明每行的意思 Public Declare Function GetTickCount Lib "kernel32" () As LongSub delay(dt As Long)Dim t As Longt = GetTickCountDoDoEventsLoop Until GetTickCount - t > dtEnd Sub
Public Declare Function GetTickCount Lib "kernel32" () As Long‘得到系统启动以来毫秒数的API
Sub delay(dt As Long)’延迟过程开始
Dim t As Long‘定义变量t
t = GetTickCount’将系统启动以来毫秒数赋给t
Do‘开始循环
DoEvents’防止程序崩溃
Loop Until GetTickCount - t > dt‘直到延时时间等于dt结束延时,用GetTickCount - t判断延时时间
End Sub’结束过程