取得某个进程CPU的占用率

摘要: /* percent = (user_time_diff + kernel_time_diff) * 100 / (cpu_num * system_time_diff) */#include<windows.h>#include<stdio.h>#include <pdh.h>#include <Tlhelp32.h>int main(){ // Find the specified Process HANDLE hProcess = NULL; PROCESSENTRY32 pe = {sizeof(pe)}; HANDLE hSnapSho 阅读全文
posted @ 2012-05-02 22:57 zengqh 阅读(693) 评论(0) 推荐(0)