有没有办法确定从开机到 Windows 启动所需的时间
我希望能够知道从通电到 Windows 启动需要多长时间。 有没有办法回顾性地确定这一点(即一旦 Windows 启动)? BIOS/CMOS 是否保留最后启动时间? 是否可以从 RDTSC 中得知机器已经运行了多长时间并减去 Windows 启动时间?
I would like to be able to tell how long it takes to get from power on to windows starting.
Is there a way of determining this retrospectively (ie once windows has started)?
Does the BIOS/CMOS hold a last boot time?
Would it be possible to tell from RDTSC how long a machine has been running for and subtract the windows boot time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试 BootTimer 或 BootRacer 看看它们中的任何一个都会做你想要的事情。
我不相信你可以在 Windows 启动后确定这一点。我不知道有任何 BIOS 可以存储上次启动时间。但在任何现代机器上,如果从开机到调用操作系统引导加载程序之间的时间(基本上是运行 POST 例程)花费的时间超过几秒钟,出了问题。
您是否尝试以编程方式执行此操作以获得机器在线且可用的准确时间? POST 花费的几秒钟所导致的不准确性似乎不会产生重大影响。如果您要进行基准测试或优化目的,这两个实用程序中的任何一个都应该适合您。
You might try BootTimer or BootRacer to see either of them will do what you want.
I don't believe you can determine this after Windows is started. I'm not aware of any BIOS that stores the last boot time. But on any modern machine, if the time between power on to calling the OS boot loader (essentially the time it takes to run the POST routines) takes longer than a few seconds, something is wrong.
Are you trying to do this programmatically to get the accurate amount of time that the machine has been online and usable? The inaccuracy resulting from the few seconds that POST takes doesn't seem like it would make a significant difference. If you're timing for benchmarking or optimization purposes, either of these two utilities should work for you.
从 GetTickCount() 获取开机以来的时间。然后获取 Windows 在启动时触及的文件的时间戳(例如 windows\bootstat.dat)。代码如下。在我的机器上,它显示 16 秒,听起来很准确。
Get the time since power on from GetTickCount(). Then get the timestamp of a file Windows touches at boot (windows\bootstat.dat for example). Code is below. On my machine it says 16 seconds which sounds accurate.