Interrupt time is the amount of time since the system was last started, in 100-nanosecond intervals. The interrupt-time count begins at zero when the system starts and is incremented at each clock interrupt by the length of a clock tick. The exact length of a clock tick depends on underlying hardware and can vary between systems.
Unlike system time, the interrupt-time count is not subject to adjustments by users or the Windows time service, making it a better choice for measuring short durations. Applications that require greater precision than the interrupt-time count should use a high-resolution timer. Use the QueryPerformanceFrequency function to retrieve the frequency of the high-resolution timer and the QueryPerformanceCounter function to retrieve the counter's value.
The QueryInterruptTime, QueryInterruptTimePrecise, QueryUnbiasedInterruptTime, and QueryUnbiasedInterruptTimePrecise functions can be used to retrieve the interrupt-time count. Unbiased interrupt-time means that only time that the system is in the working state is counted—therefore, the interrupt-time count is not "biased" by time the system spends in sleep or hibernation.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: The QueryUnbiasedInterruptTime function is available starting with Windows 7 and Windows Server 2008 R2.
The timer resolution set by the timeBeginPeriod and timeEndPeriod functions affects the resolution of the QueryInterruptTime and QueryUnbiasedInterruptTime functions. However, increasing the timer resolution is not recommended because it can reduce overall system performance and increase power consumption by preventing the processor from entering power-saving states. Instead, applications should use a high-resolution timer.
To retrieve elapsed time that accounts for sleep or hibernation, use the GetTickCount or GetTickCount64 function, or use the System Up Time performance counter. This performance counter can be retrieved from the performance data in the registry key HKEY_PERFORMANCE_DATA. The value returned is an 8-byte value. For more information, see Performance Counters.