Thread: Timer Interval

Results 1 to 4 of 4
  1. #1
    XXkillerFin1's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Finland
    Posts
    125
    Reputation
    10
    Thanks
    81
    My Mood
    Confused

    Question Timer Interval

    Hey guys, Is it possible to change timer.interval to lower than 1?
    Helping newbies in coding
    Skype:aksuli21

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Quote Originally Posted by XXkillerFin1 View Post
    Hey guys, Is it possible to change timer.interval to lower than 1?
    Yes, and No.

    Timers.Timer has an Interval that is declared as Double. Msdn says "value must be greater than 0" -- I test with 0.01 and it works.

    Windows.Forms.Timer (which is what you get when you drag a Timer control onto your form) has an Interval that is Integer. No decimal places.



    -I'm not sure setting it any smaller will actually achieve what you want. If you want it to run as fast as physically possible, use a background Thread.
    Last edited by abuckau907; 10-24-2013 at 08:45 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. The Following User Says Thank You to abuckau907 For This Useful Post:

    XXkillerFin1 (10-25-2013)

  4. #3
    Xenocode's Avatar
    Join Date
    Jul 2013
    Gender
    female
    Posts
    12
    Reputation
    10
    Thanks
    3
    Measuring less than one millisecond on Windows is impossible.
    However, It is not the speed which does not allow it, times are in ticks which is in Windows a 100th nano second.
    But Windows is a multi tasking OS, which means that the processor is not always busy with the process the timer is handled in.

  5. The Following User Says Thank You to Xenocode For This Useful Post:

    XXkillerFin1 (10-25-2013)

  6. #4
    XXkillerFin1's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Finland
    Posts
    125
    Reputation
    10
    Thanks
    81
    My Mood
    Confused
    Quote Originally Posted by abuckau907 View Post
    Yes, and No.

    Timers.Timer has an Interval that is declared as Double. Msdn says "value must be greater than 0" -- I test with 0.01 and it works.

    Windows.Forms.Timer (which is what you get when you drag a Timer control onto your form) has an Interval that is Integer. No decimal places.



    -I'm not sure setting it any smaller will actually achieve what you want. If you want it to run as fast as physically possible, use a background Thread.
    Ok, Thanks for information + Thanked
    Helping newbies in coding
    Skype:aksuli21

Similar Threads

  1. How to code a timer in visual C++ 6.0
    By nukeist_ in forum C++/C Programming
    Replies: 5
    Last Post: 12-12-2007, 02:18 PM
  2. [C++] SpeedHacking Using Timer API
    By radnomguywfq3 in forum C++/C Programming
    Replies: 4
    Last Post: 12-01-2007, 02:38 AM
  3. HELP again :[ [with timer]
    By w00t? in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-05-2007, 02:09 PM
  4. vb6 timer problem
    By juppeli in forum Visual Basic Programming
    Replies: 6
    Last Post: 07-09-2007, 10:30 PM
  5. [Help]VB6 Trainer - buttons/timers
    By Ephemera in forum Visual Basic Programming
    Replies: 5
    Last Post: 07-05-2007, 06:58 PM