Results 1 to 5 of 5

Thread: Timer Control - Max interval

  1. #1

    Thread Starter
    Hyperactive Member gmatteson's Avatar
    Join Date
    Feb 2002
    Location
    Rhode Island, USA
    Posts
    293

    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.

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    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!

  3. #3
    Lively Member
    Join Date
    Oct 2002
    Posts
    67
    what would be the best way for one to fire an event every, say 10 minutes?

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    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

  5. #5
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    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).
    -Shurijo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width