Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
delay or wait random time visual basic
SUBMITTED BY:
vishaldagar
DATE:
July 9, 2017, 5:18 p.m.
FORMAT:
Text only
SIZE:
660 Bytes
Raw
Download
Tweet
HITS:
1065
Go to comments
Report
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
Function randomtime() As Integer
Dim min As Integer = TextBox9.Text
Dim max As Integer = TextBox10.Text
Dim final As Integer = GetRandom.Next(max - min) + min
Label9.Text = final
Return final
End Function
'then use Delay(randomtime())
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus