0
How to make console wait?
what code i can use to make console wait a few moments before runing rest of code? for example if i want to write "Hello world" for 5 seconds then clear the screen then write something else, what should i do?
3 Respostas
+ 7
Add this to the top of your code:
using System.Threading;
Then, where you want to pause, write
Thread.Sleep(numMilliseconds);
1000 millis = 1 second of waiting.
It won't work on the Code Playground with how it works, though. You'll have to run the code on a computer.
0
thank you
- 1
didn't mean that. edited question.