Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait Command

Status
Not open for further replies.

EnemyGateIsDown

Technical User
Oct 3, 2002
235
GB
Hi guys,

I have an application which needs to scan a database every X seconds and then sleep for X seconds before scanning again.

Can anyone tell me how to make my application sleep for x seconds before continuing the loop?

Any help is as always greatly appreciated.

Cheers,

Chris
 
try this for 1 second

System.Threading.Thread.Sleep(1000)
 
I think what you need is a timer just set the time between ticks (in milliseconds) and then put your code in the eventhandler ontick (I think) and then you need to start the timer in the load event of the form (or somewhere else) like this. timer1.start.

Watch out there are 3 differnt kinds of timers and each has it's own methods.

Christiaan Baes
Belgium

"My new site" - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top