Remaining time in a thread....

H

HyperX

Hi,

I'm using

Thread.Sleep(50000);

and I want to display to the user when the current thread will become
active, how do I do that in c#?

Regards,

HyperX.
 
M

Mattias Sjögren

and I want to display to the user when the current thread will become
active, how do I do that in c#?

If you're putting the UI thread to sleep, it can't do anything. That
includes displaying things to the user. It's generally a bad idea to
sleep a UI thread, since the app appears to be hung to the user.

Plus, there's no way to really know when the sleeping thread will run
again, the scheduler decides that. The thread will sleep at least
50000 msec, but it could be more.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top