How does Process.TotalProcessorTime act on a multi-processor computer?

  • Thread starter Thread starter john
  • Start date Start date
J

john

For example, if you have a dual-processor computer, and your process
runs for an hour using 100% of both CPUs, would
Process.TotalProcessorTime return a TimeSpan representing one hour or
two?

thanks
 
I don't have more than one CPU, but I do have a multi-threading CPU (to the
OS, it looks exactly like two CPUs), and the TotalProcessorTime works as it
should. Also (assuming you have a dual-processor system), you can look at
the processor time in the processes list of the task manager. If that's
correct, then Process.TotalProcessorTime will also be correct, as they use
the same APIs to get the result.

Chris
 
Chris LaJoie said:
I don't have more than one CPU, but I do have a multi-threading CPU (to the
OS, it looks exactly like two CPUs), and the TotalProcessorTime works as it
should. Also (assuming you have a dual-processor system), you can look at
the processor time in the processes list of the task manager. If that's
correct, then Process.TotalProcessorTime will also be correct, as they use
the same APIs to get the result.

Chris

Can you explain what you mean when you say "TotalProcessorTime works
as it should"? I am trying to figure out what "should" is. If you have
a dual-processor computer, and your process runs for an hour using
100% of both CPUs, would Process.TotalProcessorTime return a TimeSpan
representing one hour or
two?

thanks
 
Back
Top