We have discussed timers, see the post
zz - reprint of Comparing the Timer Classes in the .NET Framework Class Library
C# have provided four kinds of timers for user to use.
They are in the following namspaces.
- System.Timers.Timer
- System.Threading.Timer
- System.Windows.Forms.Timer
- System.Windows.Timer
How to specify infinite timeout value. You can specify infinite timeout value as follow.
m_threadTimer = new System.Threading.Timer(StartFieldSubscribeCallback, null, Timeout.Infinite, Timeout.Infinite);
So the key is the System.Threading.Timeout, which has a Infinite number, (its real value is -1);
探讨.NET框架中四种定时器类的区别与使用
本文深入解析.NET框架提供的四种定时器类(System.Timers.Timer, System.Threading.Timer, System.Windows.Forms.Timer, System.Windows.Timer)的特性与用法,并详细说明如何设置无限超时值。
1196

被折叠的 条评论
为什么被折叠?



