Cpu Usage (Second Posting)

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

    #1

    Cpu Usage (Second Posting)

    Hi, all!

    Thanks a lot for your responses. We are using the GetProcessTimes for
    calculation of cpu usage. We are using the following calcution for get cpu
    usage:

    (((NUserTime - OUserTime) + (NKernelTime - OKernelTime))*1 00) / (NTime -
    OTime)/NumProcessors,
    where
    NUserTime - is the user time during process execution
    OUserTime - is the last user time during process execution
    NKernelTime - is the kernel time during process execution
    OKernelTime- is the kernel time during process execution
    NTime - is the current time
    OTime - is the last time
    NumProcessors - is the number of processors.

    Are we right?

    Thanks a lot in advance.

    Best regards,
    Paulo Eduardo




  • Hendrik Schober

    #2
    Re: Cpu Usage (Second Posting)

    Paulo Eduardo <PauloEduardo@d iscussions.micr osoft.com> wrote:[color=blue]
    > [...]
    > Are we right?[/color]

    That depends on what you want to do.
    From what I read in the other thread, you want
    your thread/process to never use more than 20%
    of the CPU time. Actually, as a user, I wouldn't
    want this. What I wanted instead is that it uses
    all idle time. Why throttle it back if my machine
    sits around idly?
    Which is where setting priorities comes in. If my
    machine is busy, it will prevent a low-priority
    thread/process from getting much CPU time. if my
    machine is idle, it will even give CPU time to
    the low-priority threads/processes.
    That's what the OS' scheduler is for.
    [color=blue]
    > Thanks a lot in advance.
    >
    > Best regards,
    > Paulo Eduardo[/color]

    Schobi

    --
    SpamTrap@gmx.de is never read
    I'm Schobi at suespammers dot org

    "Coming back to where you started is not the same as never leaving"
    Terry Pratchett


    Comment

    • Hendrik Schober

      #3
      Re: Cpu Usage (Second Posting)

      Paulo Eduardo <PauloEduardo@d iscussions.micr osoft.com> wrote:[color=blue]
      > [...]
      > Are we right?[/color]

      That depends on what you want to do.
      From what I read in the other thread, you want
      your thread/process to never use more than 20%
      of the CPU time. Actually, as a user, I wouldn't
      want this. What I wanted instead is that it uses
      all idle time. Why throttle it back if my machine
      sits around idly?
      Which is where setting priorities comes in. If my
      machine is busy, it will prevent a low-priority
      thread/process from getting much CPU time. if my
      machine is idle, it will even give CPU time to
      the low-priority threads/processes.
      That's what the OS' scheduler is for.
      [color=blue]
      > Thanks a lot in advance.
      >
      > Best regards,
      > Paulo Eduardo[/color]

      Schobi

      --
      SpamTrap@gmx.de is never read
      I'm Schobi at suespammers dot org

      "Coming back to where you started is not the same as never leaving"
      Terry Pratchett


      Comment

      Working...