timeGetTime(), getSystemTime(), GetTickCount()

This is a discussion on timeGetTime(), getSystemTime(), GetTickCount() within the Windows Programming forums, part of the Platform Specific Boards category; What are the differences between these three functions? timeGetTime() and GetTickCount() seem exactly the same because they both return a ...

  1. #1
    Shadow12345
    Guest

    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
    Posts
    20
    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 www.nvidia.com - and search for timer timings, or something similar.

    Regards

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-14-2006, 11:28 PM
  2. GetTickCount()
    By ElastoManiac in forum Windows Programming
    Replies: 3
    Last Post: 12-17-2005, 02:49 PM
  3. GetLocalTime & GetSystemTime ?
    By SAMSAM in forum Windows Programming
    Replies: 9
    Last Post: 02-05-2003, 01: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21