C
Christoph Nahr
Compared with System.Timers.Timer, that is.
Timers.Timer is more precise, has a slightly enhanced functionality,
and is easily synchronized with a Windows Forms application's
foreground thread by setting one (1) property after construction.
Moreover, Windows.Forms.Timer spams your application's message queue
with Tick events, thus increasing the overhead of timer events.
Timers.Timer just calls the event handler directly (after thread
marshalling if necessary).
The MSDN documentation has adopted somewhat of a used car salesman
language and is less than enlightening ("optimized for Windows Forms
applications"!?). But after looking at both classes with Reflector
and seeing the improved application responsiveness with Timers.Timer,
it seems to me that nobody in his right mind would ever want to use
Windows.Forms.Timer.
So can anyone write an apology for Windows.Forms.Timer, or is this
just a legacy class because the responsible team didn't want to leave
this venerable piece of Win16/32 functionality unwrapped?
Timers.Timer is more precise, has a slightly enhanced functionality,
and is easily synchronized with a Windows Forms application's
foreground thread by setting one (1) property after construction.
Moreover, Windows.Forms.Timer spams your application's message queue
with Tick events, thus increasing the overhead of timer events.
Timers.Timer just calls the event handler directly (after thread
marshalling if necessary).
The MSDN documentation has adopted somewhat of a used car salesman
language and is less than enlightening ("optimized for Windows Forms
applications"!?). But after looking at both classes with Reflector
and seeing the improved application responsiveness with Timers.Timer,
it seems to me that nobody in his right mind would ever want to use
Windows.Forms.Timer.
So can anyone write an apology for Windows.Forms.Timer, or is this
just a legacy class because the responsible team didn't want to leave
this venerable piece of Win16/32 functionality unwrapped?