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

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.
ba272Asked:
Who is Participating?
 
cookreConnect With a Mentor Commented:
Thread.Sleep(NumberOfMilliseconds);

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

How do you determine that it didn't pause?

0
 
ba272Author Commented:
Thanks.  I'll give it a try.
0
 
Timbo87Commented:
It's in the System.Threading namespace if you can't find it.
0
 
SirusdvCommented:
System.Threading.Thread.Sleep(x);

X = number of milisecconds to sleep.
0
 
God_AresCommented:
also could you describe WHY you want this,.. we could offer other solutions too,...


regards,..

Floris Briolas
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.