作用:调用次过程可以让程序执行下一条语句前等待一段时间。
用法:
1 2 3 4 5 6 7 8 9 10 11 |
Call Sub Delay(1000) '延时1秒 Public Sub Delay(ByVal DealyTime As Single) '变量DealyTime 延时毫秒数 Dim TimerCount As Single DealyTime = DealyTime / 1000 TimerCount = Now.Second + DealyTime '增加x秒 While TimerCount - Now.Second > 0 Application.DoEvents() System.Threading.Thread.Sleep(1) End While End Sub |
原文链接:VB.NET延时过程,转载请注明来源!