开发者

QueryPerformanceCounter Status?

I've read some a开发者_JS百科bout the problems and inaccuracy of the QPC implementation. But all those discussions and articles seem rather out of date.

Anyone know what the current status is of the QPC functionality on the latest Win7 OS and Intel/AMD cpus? Has there been any improvements? Is e.g. Turbo Boost still a big issue?

I'm mainly interested in this since I need to decide between using timeGetTime and QueryPerformanceCounter for timing in my application.


QPC was patched software side by microsoft ages ago (old kb article on the problem: http://support.microsoft.com/kb/895980 ). This fix can be installed on any target system for piece of mind (I've seen a few games doing this), however it shouldn't be needed. All newer processors have a hardware fix/compensation for this, as well as having the TSC correctly synced between cores, so the problems with RDTSC based timers are eliminated. The hot-fix can be gotten from here: http://support.microsoft.com/?id=896256 i'm not sure if there is anything for other systems, but from the looks of it this fix was inheirent in windows vista and windows 7 based OSes. As for the question of accuracy, that depends on the hardware itself, however Microsoft says QPC is the most reliably accurate timer you can get (with decent performance), so short of inline __rdtsc(), I doubt you'll get any more accurate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜