CPU Utilization

J

Jakub Cermak

Hi,
how can I determine how much % of CPU is my process using? Something
like CPU column in process list in task manager. I wanna to make an
"guard thread" for detecting too high CPU utilization (because of
infinite loops and other bugs).
--
Best regards,

Jakub Cermak
ICQ 159971304
http://cermi.wz.cz
 
W

Willy Denoyette [MVP]

| Hi,
| how can I determine how much % of CPU is my process using? Something
| like CPU column in process list in task manager. I wanna to make an
| "guard thread" for detecting too high CPU utilization (because of
| infinite loops and other bugs).
| --
| Best regards,
|
| Jakub Cermak
| ICQ 159971304
| http://cermi.wz.cz

Use the "performance monitor" for this, it makes little (or no) sense to
implement this in your own application.

Willy.
 
M

Michael Nemtsev

use PerformanceCounter class where specify properties

CategoryName = "Processor"
CounterName = "% Processor Time"
InstanceName = your process name

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top