Knowing how fast your webpage loads is crucial to how quickly your visitors retrieve your content.
Using this simple C# Script in ASP.NET will display the load time of your webpages.
[ASP.NET (C#) - Place this at the head of your page.]
CFFCS |
|
ASP.NET (VB/C#)
// Using System.Diagnostics;
Stopwatch watch = Stopwatch.StartNew();
HttpContext.Current.Items["PageTimer"] = watch;
[ASP.NET (C#) - Place this in the Footer of your page.]
CFFCS |
|
ASP.NET (VB/C#)
Page Load time: <%= ((Stopwatch)HttpContext.Current.Items["PageTimer"]).Elapsed.TotalMilliseconds.ToString("F2") %> ms
Your output should look something like this.
Page Load time.: 7.81 ms
That is 7.81 Milliseconds to load the page.