I need a better design for sleeping Task than Thread.Sleep, I'm using the Task class.
In my wpf app i run a Task, this task runs another couple of tasks, each of this tasks first login to and Internet website, after they login they need to wait couple of seconds and inform the user when they will proceed further and this is my problem, because with Thread.Sleep i can't report the progress.
There are more functions than login, it's about 5-6, all of them request an Internet resource, and between them there need to be a sleep time with remaining time report send do gui, this 5-6 function are all in one Task, but there could be many tasks.
What i need is to make the task wait, but also allow it to send updates on the remaining time to proceed to the GUI.
Do you have any ideas for this problem, how to make it better, maybe you have some design patterns already for such problem?
I have heard also that using Thread.Sleep is a poor design practice.
EDIT: No one knows ? Whats with some kind of self contained timer with thread wait like waithandle, autoresetevent, anybody?