MVC mini profiler, a simple effective profiler for mvc

Use Nuget to download mini profilder,

install-package miniprofiler

To use it, start the profiler in Global.asax, Application_BeginRequest()

protected void Application_BeginRequest()


    if (Request.IsLocal)





Write a condition to start the profiler, for Local Request, for special users, etc.

To use profiler for your code,

var profiler = MiniProfiler.Current; // it's ok if this is null

using (profiler.Step("Set page title"))
    for(int i=0;i<100;i++){

//do something



To display on the page, you need to include the profiler to _Layout.cshtml,


To end a profiler, end it in Global.asax, Application_EndRequest(),

protected void Application_EndRequest()




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s