求一个短时间延时程序
我用Inet1.Execute来打开一个网页,程序如下:
Inet1.Execute Url, "Post ", PostData, " "
Do While Inet1.StillExecuting
DoEvents
Loop
但在执行的过程中CPU占用100%
请问有什么代替DoEvents而又不占用CPU的东西?
[解决办法]
这个简单啊。看下面代码
延时函数:
Private Declare Function Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long) As Boolean
调用方法:
Call Sleep(2000)