-
Notifications
You must be signed in to change notification settings - Fork 4
TimingService
Michael Lidgren edited this page Sep 12, 2020
·
2 revisions
TimingService is a low overhead instrumented profiling tool.
TimingService.IsEnabled = true;
var chrome = new ChromeTraceTimingConsumer("myfile.json");
void MyFunction()
{
using var _ = new Timing("someName"); // constant strings are encouraged to avoid allocations
// do stuff we want to measure here
}
This is necessary for all timing events to be included and myfile.json to be properly terminated.
TimingService.TriggerFlush(true); // this will set TimingService.IsEnabled to false
chrome.Dispose();
In chrome, go to chrome://tracing/
and drag the resulting myfile.json
into the browser