Delay

D

David Webb

Hi,

I am writing an app and I need to simulate an 8 second delay. I've
looked at the timer but can't seem to get it to delay - I'm sure there
is something wrong with how I've done it. Does anyone have a delay sub
routine or something similar that they could post (VB.NET CF please!)
that will delay for a specified period of time?

Thanks in advance.

Regards,

David.
 
A

Alex Feinman [MVP]

Or using System.Threading.Timer to invoke a callback routine (one shot
timer):

m_Timer = new Timer(new TimerCallback(myTimerCallback), this, Seconds *
1000, Timeout.Infinite); // One shot timer for Seconds sec

private void myTimerCallback(object state)
{
// do something here
}
 
C

Chris Tacke, eMVP

Since it's likely based on an OS timer, it's guaranteed not to be less than
the time specified, though it could easily be (and often is) more.
 

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

Top