Multi-threads timers: System.Threading.Timer and System.Timers.Timer (.net framework):
App will handle timer event on a thread pool thread. Timers.Timer is a wrapper for Threading.Timer. They are used for doing time-consuming tasks.
If a System.Timers.Timeris used in a WPF application, it is worth noting that the System.Timers.Timerruns on a different thread then the user interface (UI) thread.
In order to access objects on the user interface (UI) thread, it is necessary to post the operation onto the Dispatcherof the user interface (UI) thread using Invokeor Begi
Single-thread timers: System.Windows.Forms.Timer(Windows Forms Timer)and System.Windows.Threading.DispatcherTimer(WPF timer)
Based on Windows message loop, app will handle timer event synchronously, so they may block UI.
They are called in the same thread as the application. They are
Multi-threads timers: System.Threading.Timer and System.Timers.Timer (.net framework):App will handle timer event on a thread pool thread. Timers.Timer is a wrapper for Threading.Timer. They are use