Results 1 to 5 of 5

Thread: pc independent timer?

  1. #1

    pc independent timer?

    I use a timer to call a procedure every 16ms. On my pc this works ok. But on another pc (cyrix 700mhz) it seems to mis half the calls. Is there a pc (speed) independent timer? It seems that 16ms is not equal on all pc's?

    Thanks for your answer in advance!
    http://3das.noeska.com - create adventure games without programming

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    pc independent timer?

    My Guess is that the program hasn't finished what you do inside the timer and therefore cant call it again until finished. (16ms is very quick).

    Try the same program with a 100ms timer and see if it gives the same results on the two PCs. (Then you know its the processing speed).

    From what I've heard

    timegettime (uses MMSystem) is the most accurate timer.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #3

    pc independent timer?

    Use GetTickCount to see how long it takes to execute that procedure to find out if it's even possible to execute the code every 16ms.
    Ask me about the xcess game development kit

  4. #4

    pc independent timer?

    I am using the threaded timer from http://www.carlosb.com now. This solved my timing problem.
    http://3das.noeska.com - create adventure games without programming

  5. #5

    pc independent timer?

    The GetTickCount is extremly inacurate. I tested it and its accuracy was something between 10 to 20 ms in my machine.

    Look at my code in this thread:
    http://terraqueous.f2o.org/dgdev/viewtopic.php?t=999
    This is as accurate as you can get, I think. But I don't know about their platform independency.

    Siim

Bookmarks

Posting Permissions

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