Friday, April 20, 2012

How to delay code kind of like "ping localhost..." except in C#

Is it possible to run some code in C# , wait a few seconds, then keep going? I know you can use a timer but is there an easier, quicker way? Like in batch you can do:

echo Hello
ping localhost -n 10 > nul
echo World
pause > nul

So can I do this in C# , and would it work with Winforms or just Console, because I need it for Winforms...

No comments:

Post a Comment