QueryUnbiasedInterruptTime function
Gets the current unbiased interrupt-time count, in units of 100 nanoseconds. The unbiased interrupt-time count does not include time the system spends in sleep or hibernation.
Syntax
BOOL QueryUnbiasedInterruptTime( _Out_ PULONGLONG lpUnbiasedInterruptTime );
Parameters
- lpUnbiasedInterruptTime [out]
-
A pointer to a ULONGLONG in which to receive the unbiased interrupt-time count in system time units of 100 nanoseconds. Divide by ten million, or 1e7, to get seconds (there are 1e9 nanoseconds in a second, so there are 1e7 100-nanoseconds in a second).
Return value
If the function succeeds, the return value is nonzero. If the function fails because it is called with a null parameter, the return value is zero.
Remarks
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.
The interrupt-time count retrieved by the QueryUnbiasedInterruptTime function reflects only the time that the system is in the working state. Therefore, the interrupt-time count is not "biased" by time the system spends in sleep or hibernation. The system uses biased interrupt time for some operations, such as ensuring that relative timers that would have expired during sleep expire immediately upon waking.
Unlike system time, the interrupt-time count is not subject to adjustments by users or the Windows time service. Applications can use the interrupt-time count to measure finer durations than are possible with system time. 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 timer resolution set by the timeBeginPeriod and timeEndPeriod functions affects the resolution of the QueryUnbiasedInterruptTime function. However, increasing the timer resolution is not recommended because it can reduce overall system performance and increase system power consumption by preventing the processor from entering power-saving states. Instead, applications should use a high-resolution timer.
To compile an application that uses this function, define _WIN32_WINNT as 0x0601 or later. For more information, see Using the Windows Headers.
Requirements
|
Minimum supported client |
Windows 7, Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Interrupt Time
- System Power States
- Windows Time
- QueryInterruptTime
- QueryInterruptTimePrecise
- QueryUnbiasedInterruptTimePrecise