Click to See Complete Forum and Search --> : Sleep


JennyM
August 1st, 2002, 04:23 AM
Hi Guys,

Would any of you know what the equivalent of:

C++: Sleep( 1000 );

would be in C#?

Thanks,
Jenny

thugohet
August 1st, 2002, 06:00 AM
Hello!


Would any of you know what the equivalent of:

C++: Sleep( 1000 );


Try System.Threading.Thread.Sleep(1000);


Best regards,
Thomas Hetzer

JennyM
August 1st, 2002, 06:46 AM
Hi,

Thanks for that...

Does it still do the same job if you arent using threads?

Thanks,
Jenny

thugohet
August 1st, 2002, 06:59 AM
Hello!

Does it still do the same job if you arent using threads?

You are always using threads. Even if you do not start additional threads, your code is executed in the main thread. If you call Thread.Sleep(1000) from your main thread, your main thread will be blocked for one second.



Best regards,
Thomas Hetzer

JennyM
August 2nd, 2002, 03:03 AM
Thanks Thomas!
You have really helped!