Stack Overflow develops Mini-profiler. It is used in production and stack Exchange family sites use Mini-profiler.
Let's start with an example:
Step 1: Create an asp.net application
Start visual studio 2019
Open the start window and select to create a new project.
In Create new project page, search Asp.Net Web application template in the search box and then choose Next.
Enter DemoLibrary in the Project name box in configure your new project page. Then press Createbutton.

Figure 1: Create an asp.net web application

Figure 2: Configure your new project
Step 2: Install the Min-profiler .mvc5 NuGet package
Install the mini-profiler. mvc5 NuGet package from NuGet packet manager which is used to provide correct integration with ASP.NET MVC.
Right-click on the project and select the Manage NuGet package.
Search miniprofiler.mvc5 in NuGet page in the search box. SelectMiniProfiler.Mvc5 from the list, and then click on the Install button.

Figure 3: Install Min-profiler.mvc5 package from NuGet package manager
Step 3: Add configuration for Mini-profiler
Add Configuration in Global.asax file in application_start method.
Add following block of code inside application_start method on Global.asax file.
To use MiniProfiler.Configure() method you have to add using StackExchange.Profiling; library in Global.asax file.
MiniProfiler.Configure(new MiniProfilerOptions());
Add Application_beginrequest() and Application_endrequest() method in Global.asax file
protected void Application_beginrequest()
{
MiniProfiler profiler = null;
if (Request.IsLocal)
{
profiler = MiniProfiler.StartNew();
}
}
protected void Application_endrequest()
{
MiniProfiler.Current?.Stop();
}
Step 4: Add Script in the view page
The easiest way of adding script is to add a script in shared/_Layout.cshtml master view.Add using StackExchange.Profiling; namespace to use @MiniProfiler.Current.RenderIncludes() method in view page.
Add following one-line code into _Layout.cs page:
Step 5: Add Configuration for route request
Let's run the project and nothing happens because Miniprofiler dependent on JavaScript and .js request therefore .net request is not executed.
Add following block of code in configuration file
Now run your project and you will get MiniProfiler UI on the left corner of the application and by click, you will get execution time information.

Figure 4: Run project
Step 6: To track MVC controller
Current view display overall execution which is not very useful. In the MVC application by adding a new filter into the pipeline can bit more information on the execution time of each action.