maximum value for timer

﹥>﹥吖頭↗ 提交于 2019-12-12 23:42:38

问题


what is the maximum interval for a timer to work in C#?

is it the maximum value of int 32?

can i change it to int 64?

If i change, that is ONE big IF, will a timer still be working?


回答1:


System.Timers.Timer.Interval:

The time, in milliseconds, between Elapsed events. The value must be greater than zero, and less than or equal to Int32.MaxValue. The default is 100 milliseconds.

You cannot assign an Int64 to an Int32 (that is larger than Int32.MaxValue)

Of interest: Comparing the Timer Classes in the .NET Framework Class Library




回答2:


Oddly enough if you search for winforms timer it comes right up. The interval property is an int.



来源:https://stackoverflow.com/questions/3993765/maximum-value-for-timer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!