Sunday, October 30, 2011

Calculate time taken in generating Page in the footer.

Sometime we want to show total time taken by the page to process in the footer. As shown in the below image.

Here is a simple code which helps you to calculate the time taken by ASP page to get generated.

Dim dblStartTime 'Holds the start time for the page process%>

dblStartTime = Timer() 'The Timer function returns the number of seconds, and milliseconds, since 12:00 AM.

Response.Write("<br /><span class=""text"" style=""font-size:10px"">Copyright &copy;2001-2011 <BR><a href="""" target=""_blank"">NEBULA TECHNOLOGIES (INDIA) PVT LTD.</a></span>")

Response.Write ("<span ><br /><br /> This page was generated in" & " " & FormatNumber(Timer() - dblStartTime, 3) & " " seconds "</span>")

Enhanced by Zemanta

No comments:

Post a Comment