如何得到一个进程使用Cpu的时间???

linqiu6 2003-03-21 11:16:21
如何得到一个进程使用Cpu的时间???
...全文
30 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingzai 2003-03-24
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1427/1427746.xml?temp=.5068018
http://expert.csdn.net/Expert/topic/1099/1099362.xml?temp=.0313074
LinHanLao 2003-03-21
  • 打赏
  • 举报
回复
GetProcessTimes
The GetProcessTimes function obtains timing information about a specified process.

BOOL GetProcessTimes(
HANDLE hProcess, // specifies the process of interest
LPFILETIME lpCreationTime, // when the process was created
LPFILETIME lpExitTime, // when the process exited
LPFILETIME lpKernelTime, // time the process has spent in kernel
// mode
LPFILETIME lpUserTime // time the process has spent in user mode
);

linqiu6 2003-03-21
  • 打赏
  • 举报
回复
我主要的目地是判断这个进程是否己经死了?这个进程没有窗体句柄
kingzai 2003-03-21
  • 打赏
  • 举报
回复
Here is a couple links for you.
http://codeguru.earthweb.com/system/perfmon.shtml
linqiu6 2003-03-21
  • 打赏
  • 举报
回复
我是想一个进程如何知道自己占用了CPU100%时,自己就把自己给kill
kingzai 2003-03-21
  • 打赏
  • 举报
回复
hwo to Create and kill a process, you can see codeproject example:
http://www.codeproject.com/cpp/kill_process.asp
//in this article,when you quit the process,
if(::WaitForSingleObject(m_hPro,m_nTimeOut)==WAIT_OBJECT_0)
{
AfxMessageBox("the Process is go over");
}
CloseHandle(m_hPro);
m_nTimeOut is you want
linqiu6 2003-03-21
  • 打赏
  • 举报
回复
我说错了,是进程作用CPU的%比???
或者知道了进程ID,如何kill它(比如自己创建组件时window为它产生的dllhost.exe)

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧