Solved

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

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linq, c# 8 52
C# Linq Select From List 3 140
Web page design problem 3 41
How to get the range for the percentage from user input. 4 25
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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