Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do you pause the console for a certain amount of seconds.
Posted

1 solution

Depending on what environment you are working in.
For Native, call Sleep[^] - for CLR applications you want Thread::Sleep[^]
But...be aware that it will do just that: pause your console for the time you specify. Nothing else will happen...
 
Share this answer
 
Comments
Ron Beyer 6-Jan-14 15:06pm    
And if done for more than a few seconds Windows will think your application has stopped and gray out the window. Then after some more time it may ask if you want to end the application or keep waiting. I'm not sure how in native applications to keep the message pump going, but in managed applications you want to service the message pump. +5
OriginalGriff 6-Jan-14 15:34pm    
Short bursts, with calls to DoEvents, but I've never tried in a console app, and it's a bad solution anyway!

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