Skip to content

Instantly share code, notes, and snippets.

@necrophidia
Created February 5, 2018 05:15
Simple Sample To Use Performance Counter
using System;
namespace PerformanceCounter
{
class Program
{
static void Main(string[] args)
{
using (var counter = new System.Diagnostics.PerformanceCounter("Memory", "Available MBytes"))
{
float counterValue = counter.NextValue();
Console.WriteLine(counterValue);
// or you can do whatever you want with the value
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment