pause the thread timer: threadTimer.Change(-1, -1);

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
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
IContainer Yes No Yes

相关文章:

  • 2022-12-23
  • 2021-04-02
  • 2021-12-07
  • 2022-01-29
  • 2021-07-07
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2021-07-04
  • 2021-06-25
  • 2022-01-12
  • 2021-07-23
相关资源
相似解决方案