Solved

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

Posted on 2004-08-28
5
217 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now