I have an application behaving like autorefresh. It checks emails, new videos, jokes, etc.
My client wants these single elements check in different intervals. For example emails every minute, videos every hour, etc. So there should be option for him to write down intervals by himself into textboxes and by checking appropriate checkbox start/stop refreshing.
Application is written in wpf. My question is, whether is better option to add more DispatcherTimers
(DT), one for each of elements or stick with only one DT
and in tick function make switch?
Also, I assume that DT
's tick method runs main thread. Am I right? Is it better to run operations inside tick method on different thread if possible?