夥計們有沒有在VB中的任何選項在VB中?c#中的延遲不thread.sleep
Sub Delay(ByVal dblSecs As Double)
Const OneSec As Double = 1.0#/(1440.0# * 60.0#)
Dim dblWaitTil As Date
Now.AddSeconds(OneSec)
dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
Do Until Now > dblWaitTil
Application.DoEvents() ' Allow windows messages to be processed
Loop
End Sub
這是一個繁忙的等待 - 中絕大多數延遲方式中最差的。 – dasblinkenlight 2013-03-24 11:14:28
它看起來像你在做:'DateTime dblWaitTil = DateTime.Now.AddSeconds(dblSecs); while(DateTime.Now
2013-03-24 11:15:26
*爲什麼*你想延遲?我問,因爲你的答案可能會提供一個更好的解決辦法,而不是簡單地拖延。 – 2013-03-24 11:50:16