使用 winAPI 获取计算机工作时间 [英] get Computer working time using winAPI

查看:44
本文介绍了使用 winAPI 获取计算机工作时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取自按下电源按钮以使用 Windows API 启动 PC 后计算机的工作时间.所以它不是系统的当前时间.例如,我想计算自 Windows 启动以来经过的秒数.

I want to get my computer's working time since when I pushed the power button to start my PC using windows APIs. So it is not the system's current time. For example I want to calculate how many seconds passed since windows started.

有一个函数DWORD WINAPI GetTickCount(void);.是那个吗?

There is a function DWORD WINAPI GetTickCount(void);. Is that the one?

我的想法是,如果我们可以从 ram 或 rom 中获取诸如机器正常运行时间之类的 bios 信息?

My idea is that if we could get bios information like uptime of the machine from ram or rom?

推荐答案

GetTickCount64 记录为:

检索自系统启动以来经过的毫秒数.

Retrieves the number of milliseconds that have elapsed since the system was started.

这就是通常所说的系统正常运行时间.不过,目前还不清楚电源按钮与此有什么关系.

That is what is commonly referred as a system's uptime. It's unclear, what the power button has to do with this, though.

这篇关于使用 winAPI 获取计算机工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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