Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Code to get total time taken by webpage
Question Posted on 28 Jan 2012

Home >> DotNet >> C# >> Code to get total time taken by webpage




Below code is used to get time taken by webpage to download :-
void Application_BeginRequest(object sender, EventArgs e)
{
  Context.Items.Add("startime", DateTime.Now);
}
void Application_EndRequest(object sender, EventArgs e)
{
  //Get the start time
  DateTime dt=(DateTime)Context.Items["startime"];
  //calculate the time difference between start and end of request
  TimeSpan ts = DateTime.Now-dt;
  Response.Write("number of milleseconds for execution"+"--"+ts.TotalMilliseconds);
}
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Simplest definition of partial classes and its rules?
Definition of Tuple class with some examples?
Define Race Condition in cSharp?
C#.Net Reserve Words
can we inherit private class level variables in c#






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |