GetTickCount() 实际测量什么? [英] What does GetTickCount() actually measure?

查看:21
本文介绍了GetTickCount() 实际测量什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 Windows API GetTickCount() 实际测量?它是否测量从按下系统电源按钮那一刻起的时间?它是否也测量引导加载程序或 BIOS 加载所需的时间?我正在尝试测量 Windows 7 上的启动时间.

I want to know what does the Windows API GetTickCount() actually measure? Does it measure the time from the instant the power button of the system is pressed? Does it measure the time taken by bootloaders or BIOS to load as well? I am trying to measure the boot time on Windows 7.

推荐答案

您不应将其视为测量自"任何事情以来的时间.仅将其用作相对时钟源.换句话说,调用 GetTickCount 一次,然后做一些事情,然后再次调用它,然后减去.不要使用滴答计数的绝对值.

You should not treat it as measuring the time "since" anything. Use it only as a relative clock source. In other words, call GetTickCount once, then do something, then call it again, then subtract. Do not use the absolute value of the tick count.

未指定精确的启动时间,并且在 Windows 的调试版本中,启动时间"被人为设置为过去的 49.7 天,以暴露计时器翻转错误.

The precise start time is unspecified, and on debugging builds of Windows, the "boot time" is artificially set to 49.7 days in the past in order to expose timer rollover bugs.

这篇关于GetTickCount() 实际测量什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆