Accurate Timer that fires on relative time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unknown666
    New Member
    • Feb 2008
    • 1

    Accurate Timer that fires on relative time

    Hello,

    I am building an application that requires an accurate timer to be fired every X minutes. This x value will change based on the user's requirements.

    I've looked into using the Timer class. I cannot use this becuase it fires every X minutes from when I started the applicaation.

    For instance, if I start the application at 14:33:00 and I want it to fire every 5 minutes, it will fire again around 14:38:00. I need it to fire every 5th minute in an hour. Continuing with my example, if I start it at 14:33, it should fire at 14:35, 14:40, etc.

    Also, I wouldnt mind if it was synced to the system clock.

    My question is this:

    Does this exist? And if so, where can I find something to lead me in the right direction.

    Thanks in advance.
  • shlabadoo
    New Member
    • Feb 2008
    • 4

    #2
    Could you just find the diference between time now and the next interval, set the timer to that initial time delta, then back to 5 min after it hits the first one?

    -dan

    Comment

    Working...