Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-28
5
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Accepted Solution

by:
cookre earned 1600 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 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