maximum value for timer

2019-08-14 15:17发布

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?

标签: c# timer
2条回答
迷人小祖宗
2楼-- · 2019-08-14 15:20

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

查看更多
地球回转人心会变
3楼-- · 2019-08-14 15:46

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

查看更多
登录 后发表回答