Results 1 to 4 of 4

Thread: Timer's Current Tick Value

  1. #1

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Timer's Current Tick Value

    If one has a Timer that has an interval of 10000 = 10 Seconds, then another timer with a interval of 20 which must take timer 1's Interval subtract it from the Current Value eg 4000, how does one do this?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Timer's Current Tick Value

    The timer does not have any property which specifies the amount of time that has passed. What you can do instead, is to perform calculations. After every Timer2 tick, multiply the number of ticks that have occurred by 20, and subtract from 4000 * number of timer1 ticks.

  3. #3
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Timer's Current Tick Value

    The amount of ticks must be declared outside of the timer event too..
    If you find my thread helpful, please remember to rate me

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Timer's Current Tick Value

    If you want elapsed time then the best thing to do is store the current time (Dim startTime As Date = Date.Now) in a variable when you start. You can then Subtract that variable from the current time later (Dim elapsedTime As TimeSpan = Date.Now.Subtract(startTime)).
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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