A C# visual profiling library using Google Chrome's tracing tool.
Whenever you want to measure a piece of code, you just have to use ChromeTrace.Profile
,
and ChromeTracing.NET will do the rest.
public static void Main(string[] args)
{
ChromeTrace.Init();
using (ChromeTrace.Profile("Test"))
{
Random rand = new Random();
int sleep = 1000 + rand.Next(1000);
Console.WriteLine("Night night!");
System.Threading.Thread.Sleep(sleep);
Console.WriteLine($"Woke up after {sleep} ms");
}
}
When the application ends its execution, a trace.json
file is generated. This file
can be directly loaded to Google Chrome's chrome://tracing
tool.