简体   繁体   English

从操作系统启动开始测量CPU使用率

[英]Measure CPU usage starting from OS boot

How to write and run program capable of showing CPU usage starting from OS boot time? 如何编写和运行能够从操作系统启动时间开始显示CPU使用率的程序?

I'd like to measure how much processor, hard disk and RAM is being used during system start-up. 我想测量系统启动期间正在使用多少处理器,硬盘和RAM。

OS: Ubuntu 16.04 or Win 7 or any other on which it'll be easier to implement that. 操作系统:Ubuntu 16.04或Win 7或其他将更易于实现的操作系统。

Windows: you can call GetTickCount64 to get the time since the system was started, and QueryIdleProcessorCycleTime to get idle time. Windows:您可以调用GetTickCount64获取自系统启动以来的时间,而QueryIdleProcessorCycleTime可以获取空闲时间。 Subtract to get the time spent doing something useful. 减去以花费时间做一些有用的事情。

As for HDD and RAM usage depends on what do you mean by 'used'... Number of reads? 至于HDD和RAM的使用情况取决于您所说的“已用”是什么意思...读取次数? writes? 写? Allocated pages? 已分配页面? Committed pages? 提交页面? Virtual or physical memory? 虚拟还是物理内存? Page file requests - are they considered as HDD or RAM usage? 页面文件请求-它们是否被视为HDD或RAM使用情况?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM