Cpu Usage (Second Posting)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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))*100) / (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
 
Paulo Eduardo said:
[...]
Are we right?

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.
Thanks a lot in advance.

Best regards,
Paulo Eduardo

Schobi

--
(e-mail address removed) 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
 
Back
Top