Is there a pause function? I want to run a program and then after it runs, pause for a few minutes and then run it again.
Printable View
Is there a pause function? I want to run a program and then after it runs, pause for a few minutes and then run it again.
Hi,
You don't need a pause function. What are you going to pause for?
If you are waiting for a user response a MessageBox or a Button will suffice.
If you want to wait for a certain amount of time, then use a loop with a timer check.
If you want to pause while another application is running then there is a Thread.Sleep; Thread.Suspend and Thread.Resume, which you can see in MSDN Help under "Pausing Threads"
how do you loop with a timer?
Hi,
The easiest way is
VB Code:
Dim dTime As Date = Date.Now.AddSeconds(10) Do : Loop Until Date.Now > dTime
The above waits 10 seconds but you can work in minutes, hours days etc.