Thread: Timers

  1. #1
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463

    Timers

    I wasn't sure where to put this, but the game board seems like a good cross of everything. Yesterday I was reading through one of gametutorials.com's OpenGL tutorials on frames per second. It talked about the best windows timer being QueryPerformanceCounter() and QueryPerformanceFrequency(). How would these compare to using C's standard timer functions. Would the C timer run any lower in the architecture or be more accurate than the windows functions?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    The windows functions are a lot more accurate.

    QueryPerformanceFrequency() gives you the number of cycles per second your processor is doing, and QueryPerformanceCounter() will give you the cycle count you are on. You cant really get any more accurate than that.
    Last edited by bithub; 09-20-2004 at 11:49 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Threads and Timers
    By scioner in forum C Programming
    Replies: 8
    Last Post: 03-22-2008, 07:56 AM
  2. Enumerating timers and hotkeys
    By maxorator in forum Windows Programming
    Replies: 3
    Last Post: 01-01-2007, 11:47 AM
  3. switch cases and timers
    By soranz in forum C++ Programming
    Replies: 5
    Last Post: 10-02-2005, 06:43 PM
  4. Timers, Timers, Timers!
    By Stan100 in forum Game Programming
    Replies: 9
    Last Post: 01-24-2003, 04:45 PM
  5. Timers
    By Mox in forum Windows Programming
    Replies: 2
    Last Post: 11-09-2001, 04:34 AM