TracePrint Date()
TracePrint now()
Dim t1
t1 = now()
For 5
Do
Delay 1000
t2 = now()
TracePrint "t1是"&t1
TracePrint "t2是"&t2
TracePrint t2 - t1
差年=datediff("yyyy",t2,t1)
TracePrint "差年是"&差年
差秒=datediff("s",t1,t2)
TracePrint "差秒是" & 差秒
差 = datediff("s", t1, now())
TracePrint 差
If 差 >= 20 Then
t1=now()
TracePrint "已大于"&差&"程序跳出循环"
Exit Do
End If
Loop
Next