Advertisement

10.01.2007 at 01:04PM PDT, ID: 22864755
[x]
Attachment Details

c# better sleep

Asked by jackjohnson44 in .NET, C# Programming Language

Tags: sleep

I wrote a program that does something every 10 seconds.  I am using a sleep, but the program seems to lock up duding the sleep.  Is there a better way to do this so the program is not locked up and will respond to a button press?  Basically I start the process wiht one button and it loops 1000 times until another button is pressed and a flag is set to false.  Currently I have to keep pressing the stop button since the program seems to lock.

System.Threading.Thread.Sleep(5000);

Thanks

Start Free Trial
 
Loading Advertisement...
 
[+][-]10.01.2007 at 01:12PM PDT, ID: 19993781

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2007 at 09:55AM PDT, ID: 20000082

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2007 at 10:39AM PDT, ID: 20000469

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, C# Programming Language
Tags: sleep
Sign Up Now!
Solution Provided By: JimBrandley
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.24.2007 at 06:39AM PDT, ID: 20138716

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628