What is the maximum amount of mil. seconds the timer control supports? Does it allow 30minutes as an interval?
i.e 60000miliseconds = 1 sec
so 60000 * 30 = 30min
thanks.
Printable View
What is the maximum amount of mil. seconds the timer control supports? Does it allow 30minutes as an interval?
i.e 60000miliseconds = 1 sec
so 60000 * 30 = 30min
thanks.
The range for the timers interval property ranges from 1 to 64,767 (so it caps at about 64.8 seconds).
Some other notes about timers:
The interval is not guaranteed to occur at the exact interval - if you need accuracy then check the system clock. The true percision of an interval is no more than 1/18 of a sec.
Hope this helps!
what would be the best way for one to fire an event every, say 10 minutes?
maybe summing up a value in timer ticks until it reaches 10 minute, or check time difference in each tick.
I use a server based timer and I can set the interval to up to 12 hours (12 * 60 * 60 * 1000). I haven't tried anything higher than that, but I think it would support it.
The old VB6 timer's max was 64, but now it is defined as a double.
Timer.Interval Property [Visual Basic]PHP Code:Private myTimer As New System.Timers.Timer()
----------------------
'Create new Server based Timer
AddHandler myTimer.Elapsed, New
System.Timers.ElapsedEventHandler(AddressOf Me.myTimer_Elapsed)
myTimer.Interval = (12 * 60 * 60 * 1000)
myTimer.Start()
----------------------
Sub myTimer_Elapsed(ByVal sender As System.Object,
ByVal e As System.Timers.ElapsedEventArgs)
'do stuff here
....
End Sub
Public Property Interval As Double
The Double value type represents a double-precision 64-bit number with values ranging from negative 1.79769313486232e308 to positive 1.79769313486232e308, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and Not-a-Number (NaN).
So yes, you can set it to 30 minutes (30 * 60 * 1000).