I have a long running SQL query inside a page that I\'ve sped up by using an async task:
using System.Threading.Tasks;
...
var asyncTask = new Task
What you can do is to create a new profiler and attach it to the web one.
var newProfiler = new MiniProfiler("- Other task (discard this time)", ProfileLevel.Verbose);
MiniProfiler.Current.AddProfilerResults(newProfiler);
var asyncTask = new Task(() =>
{
using (newProfiler.Step("Async!"))
{
Thread.Sleep(500);
using (newProfiler.Step("Async 2!"))
{
Thread.Sleep(1000);
}
}
});
asyncTask.Start();
The new profiler will have wrong times in its declaration but the steps are gonna be ok.