QueryUnbiasedInterruptTimePrecise 函数 (realtimeapiset.h)

获取当前无偏差中断时间计数,其形式比 QueryUnbiasedInterruptTime 更精确。 无偏差中断时间计数不包括系统处于睡眠或休眠状态的时间。

语法

void QueryUnbiasedInterruptTimePrecise(
  [out] PULONGLONG lpUnbiasedInterruptTimePrecise
);

参数

[out] lpUnbiasedInterruptTimePrecise

指向 ULONGLONG 的指针,其中接收系统时间单位为 100 纳秒的无偏差中断时间计数。 除以 1000 万(即 1e7)得到秒 (每秒有 1e9 纳秒,因此第二) 有 1e7 100 纳秒。

返回值

备注

QueryUnbiasedInterruptTimePrecise 类似于 QueryUnbiasedInterruptTime 例程,但更精确。 QueryUnbiasedInterruptTime 报告的中断时间基于系统时钟计时器的最新时钟周期。 系统时钟计时器是定期为系统时钟生成中断的硬件计时器。 系统时钟计时器中断之间的统一周期称为系统时钟周期,通常介于 0.5 毫秒到 15.625 毫秒之间,具体取决于硬件平台。 QueryUnbiasedInterruptTime 检索的中断时间值在系统时钟周期内准确。

为了提供比 QueryUnbiasedInterruptTime 更精确的系统时间值, QueryUnbiasedInterruptTimePrecise 会直接读取计时器硬件,因此 QueryUnbiasedInterruptTimePrecise 调用可能比 QueryUnbiasedInterruptTime 调用慢。

调用 KeQueryTimeIncrement 例程来确定系统时钟周期的持续时间。

另请参阅 QueryUnbiasedInterruptTime 中的备注。

注意QueryUnbiasedInterruptTimePrecise 函数在调试 (“checked”) Windows 内部版本时生成不同的结果,因为中断时间计数和时钟周期计数将提前大约 49 天。 这有助于识别在系统长时间运行之前可能不会发生的 bug。 选中的版本可通过 Microsoft 开发人员网络 (MSDN) 网站向 MSDN 订阅者提供。
 
若要编译使用此函数的应用程序,请将_WIN32_WINNT定义为 0x0601 或更高版本。 有关详细信息,请参阅 使用 Windows 标头

要求

要求
最低受支持的客户端 Windows 10 [桌面应用 |UWP 应用]
最低受支持的服务器 Windows Server 2016 [桌面应用 |UWP 应用]
目标平台 Windows
标头 realtimeapiset.h
Library Kernel32.lib
DLL Kernel32.dll

另请参阅

中断时间

QueryInterruptTime

QueryInterruptTimePrecise

QueryUnbiasedInterruptTime

系统电源状态

Windows 时间