Timers difference
pause the thread timer: threadTimer.Change(-1, -1);
three timers difference:
three timers difference:
| Feature description | System.Timers.Timer | System.Threading.Timer | System.Windows.Forms.Timer |
| Support for adding and removing listeners after the timer is instantiated. | Yes | No | Yes |
| Supports call backs on the user-interface thread | Yes | No | Yes |
| Calls back from threads obtained from the thread pool | Yes | Yes | No |
| Supports drag-and-drop in the Windows Forms Designer | Yes | No | Yes |
| Suitable for running in a server multi-threaded environment | Yes | Yes | No |
| Includes support for passing arbitrary state from the timer initialization to the callback. | No | Yes | No |
| Implements IDisposable | Yes | Yes | Yes |
| Supports one-off callbacks as well as periodic repeating callbacks | Yes | Yes | Yes |
| Accessible across application domain boundaries | Yes | Yes | Yes |
| Supports IComponent – hostable in an IContainer | Yes | No | Yes |

浙公网安备 33010602011771号