How to get CPU Time of a process programmatically ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Envee (Envee_at_discussions.microsoft.com)
Date: 06/25/04


Date: Fri, 25 Jun 2004 10:39:01 -0700

I am trying to obtain the CPU Time like that shown by Task Manager programmatically.
The only related counter I found was the "%Processor Time" under the Process object.
Is there a way to convert the value into a "CPU Time".

According to Task Manager help. "CPU Time" column is the total processor time used by the process since it started.



Relevant Pages

  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... Well, yeah, it's supposed to tell you how long the program has ... its supposed to tell you the processor time used. ... must be sharing that CPU time with all the other programs I'm running, ... CLK_TCK isn't defined in standard C; the correct macro is ...
    (comp.lang.c)
  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... This loop probably consumes 100% CPU time while it is doing nothing. ... If the processor time used is not available or its ...
    (comp.lang.c)
  • Re: Sodding SP2!
    ... soaking up all the CPU time? ... Explorer and svchost, whatever that is. ... What percentage of processor time is each taking? ... When idle "System idle ...
    (uk.rec.sheds)
  • Re: gfortran, g95, and dual-core
    ... percent of the CPU time, so I don't see much to gain there. ... On my laptop, enabling WiFi eats about 15% of processor time and makes a perceptible dent in responsiveness. ...
    (comp.lang.fortran)
  • Re: CPU process
    ... Task manager doesn't show everything that is counted against CPU time. ... > Process is at 95-99% BUT IN THE SAME TIME it is showing that CPU usage ... > Visit Topic URL to contact author (reg. ...
    (microsoft.public.windowsxp.general)