Fastest timing resolution system

后端 未结 10 2230
死守一世寂寞
死守一世寂寞 2020-12-03 06:11

What is the fastest timing system a C/C++ programmer can use?

For example:
time() will give the seconds since Jan 01 1970 00:00.
GetTickCount() on Windows wi

10条回答
  •  死守一世寂寞
    2020-12-03 06:51

    For timing, the current Microsoft recommendation is to use QueryPerformanceCounter & QueryPerformanceFrequency.

    This will give you better-than-millisecond timing. If the system doesn't support a high-resolution timer, then it will default to milliseconds (the same as GetTickCount).

    Here is a short Microsoft article with examples of why you should use it :)

提交回复
热议问题