KeQueryUnbiasedInterruptTime routine

The KeQueryUnbiasedInterruptTime routine returns the current value of the system interrupt time count.


ULONGLONG KeQueryUnbiasedInterruptTime(void);


This routine has no parameters.

Return value

KeQueryUnbiasedInterruptTime returns the current interrupt time count in 100-nanosecond units. The count begins at zero when the computer starts. Updates to this count are suspended when the computer enters a sleep state and are resumed when the computer awakens.


Kernel-mode drivers can call this routine to measure relatively fine-grained durations.

This routine returns the system interrupt time, which is the amount of time since the operating system was last started. The interrupt-time count begins at zero when the operating system starts and is incremented at each clock interrupt by the length of a clock tick. For various reasons, such as hardware differences, the length of a system clock tick can vary between computers. Call the KeQueryTimeIncrement routine to determine the size of a system clock tick.

Note  The preceding remarks describe the behavior of KeQueryUnbiasedInterruptTime in free (or retail) builds of Windows. In checked (or debug) builds, this behavior is modified to help developers to identify bugs that might not occur until the operating system has been running for many days without being restarted. Specifically, the interrupt-time count and tick count in checked builds are advanced by approximately 49 days. For more information about checked and free builds, see Checked and Free Build Differences.

The KeQueryUnbiasedInterruptTime and KeQueryInterruptTime routines are similar, but they differ in the way in which they account for periods in which the operating system suspends updates of the interrupt time count. For example, these updates are suspended while the computer is in a system sleep state. To compensate for periods in which updates of the count are suspended, KeQueryInterruptTime returns a biased count value that it calculates by adding a bias count to the raw interrupt time count. The bias count is the estimated sum of all of the updates to the interrupt time count that the operating system missed while counting was suspended. In contrast, KeQueryUnbiasedInterruptTime returns the raw, unbiased count.

Unlike the KeQuerySystemTime routine, KeQueryUnbiasedInterruptTime returns a count value that is not affected by operations that set or reset the system time. In addition, the system time that is reported by KeQuerySystemTime is typically updated approximately every ten milliseconds. In contrast, the count that is returned by KeQueryUnbiasedInterruptTime is updated at least once per system clock tick.

In Windows 2000 and later versions of the Windows operating system, the KeQueryPerformanceCounter routine provides the finest grained running count that is available from the operating system.


Target platform



Available starting with Windows 7.


Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)






Any level

See also




Send comments about this topic to Microsoft