Results 1 to 5 of 5

Thread: Timers

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Westminster, Md.
    Posts
    163
    Any better/more acurate way to keep track of time in VB than a timer control? It'd be nice to be able to track time intervals less than a second with some degree of accuracy.


    Eiredrake

  2. #2
    Guest
    Use the QueryPerformanceCounter API. I think it's accurate up to 1 microsecond (1 millionth of a second).

  3. #3
    Guest

    Exclamation

    If you don't need that accurate, you can also use TWO timers. It still aren't so fast it should be, but much faster than with only one.

    This works atleast with VB4 (I've used the trick in my slot machine game named Merrysoft Jackpot).

  4. #4
    Guest
    Or just use GetTickCount which is most common because it is accurate up to 1ms.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Gettickcount api solves most problems it's accurate to 1ms and with iterating loops with doevents you make your timers executing with different intervals
    Heres an example at:
    http://forums.vb-world.net/showthrea...threadid=18669
    Also, here's some results using different timers:
    http://forums.vb-world.net/showthrea...threadid=18440
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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