static void Main(string[] args)
{
if (CreatePerformanecCounters())
{
Console.WriteLine("Created performance counters");
Console.WriteLine("Please restart the application");
Console.ReadKey();
return;
}
var totalOperationsCounter = new PerformanceCounter(
"MyCategory",
"# operations executed",
"",
false);
var operationsPerSecondCounter = new PerformanceCounter(
"MyCategory",
"# operations sec",
"",
false);
totalOperationsCounter.Increment();
operationsPerSecondCounter.Increment();
}