Ok, so I read in Thread.Sleep, Task.Delay, AutoResetEvent ... etc.
I see a lot of arguments that can be used, since it depends on the task being performed.
I am currently using Thread.Sleep in everything and I think I need to start avoiding it and using best practice.
This is a client application containing BackgroundWorker. An employee starts every 30 minutes to check for updated data from a web service.
Then it updates 3 int vars located in MainWindow. They do nothing with the user interface. They are simply used in checks for other working users.
Is one way to defer better than another?
If the user exits the application and I call Application.Current.Shutdown (), will it continue to work until the Thread.Sleep process finishes or is it completed, even if the thread has slept?
source
share