Thread: Which Microsoft Header should i use for Speed Tests

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Question Which Microsoft Header should i use for Speed Tests

    i was using POSIX compliant calls such as 'timezone tz' and 'gettimeofday' which Microsoft claim to support, however i've had trouble compiling. If i wanted to use Microsoft Windows calls to do speed tests on my PC which Header file is the standard for doing time based operations? and how can i find out more about what these header files contain?

    Thanks

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    QueryPerformanceCounter and related functions give access to the Windows high-res timer. But you should have asked this on the Windows board.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    The function descriptions, including header and library information can be found on msdn (QueryPerformanceCounter); google, obviously, has lots of information, too.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Question

    i found this site http://www.codeproject.com/csharp/hi...timercshar.asp

    but am still unsure whether i need to add a header file to my project to gain access to the QueryPerformanceCounter() function?

    Isnt this included in windows already ? i'm a bit confused...

    Thanks

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>but am still unsure whether i need to add a header file to my project to gain access to the QueryPerformanceCounter() function?<<

    Please follow the link I gave in my previous post to the msdn description for the api function in question. Please scroll to the bottom of that page and please note the point on that msdn page where it states:
    Quote Originally Posted by msdn,QueryPerformanceCounter
    Header Declared in Winbase.h, include Windows.h
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  6. #6
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    MSDN --> QueryPerformanceCounter function

    Header Declared in Winbase.h, include Windows.h

    What more info do you need?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class methods in header or source file?
    By TriKri in forum C++ Programming
    Replies: 13
    Last Post: 09-17-2007, 05:23 AM
  2. header file/class problems
    By Calef13 in forum C++ Programming
    Replies: 6
    Last Post: 07-20-2007, 08:33 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Retaliation towards witch king\microsoft
    By Koshare in forum Linux Programming
    Replies: 7
    Last Post: 10-19-2001, 04:54 AM
  5. I Love Microsoft
    By Witch_King in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-25-2001, 12:07 PM