: : : : : Is there an easy way to do in C# what I would do in C++ with
: : : : : delay(1000);
: : : : :
: : : :
: : : : System.Threading.Thread.CurrentThread.Sleep(1000);
: : : :
: : : : But this is deprecated. You should create some waitable object and wait for it. Also this is pretty evil since your thread is suspended for a while and it can't for example process any messages.
: : : :
: : :
: : :
: : :
: : :
: : Now I get?
: :
: : Static member 'System.Threading.Thread.Sleep(int)'
: : cannot be accessed with an instance reference;
: : qualify it with a type name instead
: :
: : Tnx for the help.
: :
: :
:
: Thread.CurrentThread.Sleep ...
:
No, the Sleep method is static:
System.Threading.Thread.Sleep(1000);
Greets,
Eric Goldstein
www.gvh-maatwerk.nl