You can get a resolution of 0.5 ms using the hidden NtSetTimerResolution() API. NtSetTimerResolution is exported by the native NTDLL.DLL library for Windows NT. See How to set timer resolution to 0.5 ms? on MSDN. However, the true achievable resolution is determined by the underlying equipment. Modern equipment supports a resolution of 0.5 ms. For more information, see Inside Windows NT High Resolution Timers . Supported permissions can be obtained by calling NtQueryTimerResolution ().
How to do:
#define STATUS_SUCCESS 0 #define STATUS_TIMER_RESOLUTION_NOT_SET 0xC0000245
Note. The functionality of NtSetTImerResolution is mainly mapped to the timeBeginPeriod and timeEndPeriod functions using the bool Set value (see Inside Windows NT High Resolution Timers for more information about the scheme and all its consequences). However, the multimedia package limits the granularity to milliseconds, and NtSetTimerResolution allows you to set values ββin milliseconds.
source share