Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
1.40/5 (2 votes)
See more:
what is a good way to put an in line delay say for 1 to 10 mS?

I know there can be threads and all kinds of exotic solutions...i need a simple delay waiting for some data to be ready...something like a WAIT command in VB...

Thx
Posted
Comments
Aravindba 5-Dec-13 21:11pm    
there is no use for delay for 1 to 10 ms for data to be ready,u need to put atleast 2 to 5 secs,bcz code is execute in 1 to 10 milli secs.
Member 2113297 5-Dec-13 21:18pm    
I may want to adjust to 100ms...

1 solution

Thread.Sleep(milliseconds)
 
Share this answer
 
Comments
Member 2113297 5-Dec-13 21:18pm    
Where do you get the "Thread" var to use with Thread.Sleep?
Mitchell J. 5-Dec-13 21:20pm    
Add "using System.Threading;" to the using block at the top of your code. Bingo!
Dave Kreskowiak 5-Dec-13 21:56pm    
Thread is not a variable. It's a class and the reason you can use it without declaring an instance of it is because the Sleep method is static.
Member 2113297 5-Dec-13 21:27pm    
VERY GOOD...works...just what i was looking for....nice and easy! Thanks,
Bert

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900