Solved

How do I make a C# program sleep for a given number of milliseconds>

Posted on 2004-08-28
5
219 Views
Last Modified: 2010-04-15
I've tried "sleep", I've tried "delay.  Both without luck.  And WAITFOR related to SQL Server.


Thanks for the help.  I'm sure it's obvious, but sometimes the most obvious problems are the worst to solve.

Thank you.
0
Comment
Question by:ba272
5 Comments
 
LVL 22

Accepted Solution

by:
cookre earned 400 total points
ID: 11923719
Thread.Sleep(NumberOfMilliseconds);

Note that that causes the entire thread or process to pause.

How do you determine that it didn't pause?

0
 

Author Comment

by:ba272
ID: 11923731
Thanks.  I'll give it a try.
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 11924235
It's in the System.Threading namespace if you can't find it.
0
 

Expert Comment

by:Sirusdv
ID: 11939095
System.Threading.Thread.Sleep(x);

X = number of milisecconds to sleep.
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 11950119
also could you describe WHY you want this,.. we could offer other solutions too,...


regards,..

Floris Briolas
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question