Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access the C# performance counter in the code?

I want to use the performance counter output in my program. How can I access the performance counter in code without using the perfmon.exe. I want to create my own performance counter app.

like image 522
Lance Avatar asked Apr 26 '10 10:04

Lance


2 Answers

This is exposed via the PerformanceCounter Class.

like image 107
Alex K. Avatar answered Oct 26 '22 23:10

Alex K.


You can fully interact with performancecounters throught the System.Diagnostics.PerformanceCounter classes (Documentation and examples here).

like image 35
Foxfire Avatar answered Oct 27 '22 00:10

Foxfire