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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

    #1

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

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

    thanks
  • Chris LaJoie

    #2
    Re: How does Process.TotalPr ocessorTime act on a multi-processor computer?

    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 TotalProcessorT ime 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.TotalPr ocessorTime will also be correct, as they use
    the same APIs to get the result.

    Chris

    "john" <johngilmer@yah oo.com> wrote in message
    news:2947476e.0 312021438.34199 410@posting.goo gle.com...[color=blue]
    > For example, if you have a dual-processor computer, and your process
    > runs for an hour using 100% of both CPUs, would
    > Process.TotalPr ocessorTime return a TimeSpan representing one hour or
    > two?
    >
    > thanks[/color]


    Comment

    • john

      #3
      Re: How does Process.TotalPr ocessorTime act on a multi-processor computer?

      "Chris LaJoie" <chris@etriptra der.com> wrote in message news:<O2eyJPUuD HA.2544@TK2MSFT NGP10.phx.gbl>. ..[color=blue]
      > 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 TotalProcessorT ime 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.TotalPr ocessorTime will also be correct, as they use
      > the same APIs to get the result.
      >
      > Chris[/color]

      Can you explain what you mean when you say "TotalProcessor Time 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.TotalPr ocessorTime return a TimeSpan
      representing one hour or
      two?

      thanks

      Comment

      Working...