المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows



C++ Programming
03-29-2009, 02:42 AM
The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

<a href="http://msdn.microsoft.com/magazine/327e1469-3e44-40e0-b985-d838afd4c1e7">MSDN Magazine March 2004