Thread: timeGetTime(), getSystemTime(), GetTickCount()

  1. #1

    timeGetTime(), getSystemTime(), GetTickCount()

    What are the differences between these three functions? timeGetTime() and GetTickCount() seem exactly the same because they both return a DWORD value that represents the number of milliseconds the system has been operating for. Looking on msdn i found getSystemTime() returns the ms member of the MMTIME structure, but they all ultimately do the same thing, and I'm not sure how they are different.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Basically the difference between the functions if the resolution (accuracy) of the returned value.

    GetTickCount only update every 11 milliseconds or so, whereas the resolution of timeGetTime is adjustable, with the timeBeginPeriod / timeEndPeriod functions - the accuracy of which depends on the OS (Win95 still returning the same value as GetTickCount for example, but W2K returning millisecond accurate timings)

    If you want a very hi-res timer, look at QueryPerformanceCounter.

    NOTE - in each of these cases, the accuracy comes at a cost - namely the execution time of these function - the least accurate being the fastest to return a result. This may or may not be of relevance to you. If you want the actual timings of the various functions, look at - and search for timer timings, or something similar.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with timeGetTime()
    By Bill83 in forum Windows Programming
    Replies: 1
    Last Post: 01-15-2006, 12:28 AM
  2. GetTickCount()
    By ElastoManiac in forum Windows Programming
    Replies: 3
    Last Post: 12-17-2005, 03:49 PM
  3. GetLocalTime & GetSystemTime ?
    By SAMSAM in forum Windows Programming
    Replies: 9
    Last Post: 02-05-2003, 02:27 AM
  4. timeGetTime() on mac
    By btq in forum C++ Programming
    Replies: 0
    Last Post: 06-04-2002, 04:32 PM
  5. Using timeGetTime()
    By Clyde in forum Windows Programming
    Replies: 2
    Last Post: 05-28-2002, 02:50 PM