Timers
Timers allow you to specify a recurring interval at which an event can be raised in your application. .NET offers three different timer mechanisms :
- System.Windows.Forms.Timer
- System.Timers.Timer
- System.Threading.Timer
- System.Windows.Forms.Timer
This timer is optimized for use in Windows Forms applications. This Windows timer is designed for a single-threaded environment where UI threads are used to perform processing. It requires that the user code has a UI message pump available and always operates from the same thread. A Tick event is raised at intervals based on the Interval property setting. - System.Timers.Timer
The server-based Timer is designed for use with worker threads in a multithreaded environment. Server timers can move among threads to handle the raised Elapsed event, resulting in more accuracy (metronome-quality) than Windows timers. The System.Timers.Timer class will call the timer event handler on a worker thread obtained from the common language runtime (CLR) thread pool.
0 Comments:
Post a Comment
<< Home