|
-
Jun 3rd, 2003, 06:37 AM
#1
Thread Starter
Hyperactive Member
Timer Control - Max interval
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.
-
Jun 3rd, 2003, 07:13 AM
#2
Fanatic Member
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!
-
Jun 3rd, 2003, 06:02 PM
#3
Lively Member
what would be the best way for one to fire an event every, say 10 minutes?
-
Jun 3rd, 2003, 06:14 PM
#4
Frenzied Member
maybe summing up a value in timer ticks until it reaches 10 minute, or check time difference in each tick.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jun 3rd, 2003, 06:32 PM
#5
Addicted Member
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.
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
Timer.Interval Property [Visual Basic]
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).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|