Lance
Lance

Reputation: 2913

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.

Upvotes: 7

Views: 11220

Answers (2)

Alex K.
Alex K.

Reputation: 175748

This is exposed via the PerformanceCounter Class.

Upvotes: 10

Foxfire
Foxfire

Reputation: 5755

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

Upvotes: 5

Related Questions