time delay

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm to delay my program for some limited time...i try using the following
codes but it doesn't work, how do i do a time delay???

'Extracted from the main function
Timer11.Start()
Do

tCC = timeCount
Loop Until timeCount > 10000

Timer11.Stop()
'End of the extraction


Private Sub Timer11_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer11.Tick

timeCounter()

End Sub

Private Sub timeCounter()
timeCount = timeCount + 1
End Sub
 
notregister said:
I'm to delay my program for some limited time...i try using the following
codes but it doesn't work, how do i do a time delay???

Set the timer's 'Interval' property to 10000 instead of letting the timer
tick 10000 times.

- or -

\\\
System.Threading.Thread.Sleep(10000)
///

Notice that this approach will block the thread for 10000. If you call this
method in your app's UI thread, the user won't be able to interact with your
application's user interface in this time.
 
NotRegister,

Notice that your function eats process time.

The function Herfried shows you with the thread waid, has the advantage that
it blocks your screen untill all is done in the routine and get therefore no
dependency errors.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top