Page 1 of 1

How to get the CPU time?

Posted: Fri Jul 31, 2009 3:50 pm
by Kevin
Hi,

Is there any way to find the CPU time which is displayed in Idle Process ?

Regards,

Kevin

Re: How to get the CPU time?

Posted: Fri Jul 31, 2009 3:53 pm
by Neo
Hi Kevin,

You can do it as follows.

Code: Select all

NTSTATUS hStatus;
SYSTEM_PERFORMANCE_INFORMATION sysPInfo;

hStatus = NtQuerySystemInformation(SystemPerformanceInformation, &sysPInfo, sizeof(sysPInfo), NULL);
if (hStatus != NO_ERROR){
       // Your code here
}
BR,

Neo