+ 3

[C# - Console] Is there any way to print chars, words or even lines one by one (by delay) in Console?

For example i want to print "Loading....." But i want those dots to appear one by one to show loading is in progress. Is it possible?

11th Aug 2020, 7:44 AM
Mosi B.
Mosi B. - avatar
3 Respuestas
+ 4
You can use Thread.Sleep(), which will delay for a certain number of milliseconds. Together with Console.Write(), you can make it display “Loading”, then wait a second before displaying the periods/dots. For Thread.Sleep(): https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread.sleep?view=netcore-3.1 Please note: it won’t run on the SoloLearn compiler, due to it not being executed on your machine.
11th Aug 2020, 8:37 AM
Rowsej
Rowsej - avatar
+ 2
Rowsej Thanks bro 🙏🏻 It worked 👌🏻 MS documents were so helpful.
11th Aug 2020, 3:32 PM
Mosi B.
Mosi B. - avatar
+ 2
No worries!
12th Aug 2020, 3:27 AM
Rowsej
Rowsej - avatar