Reputation: 1
How to display request process time in aspx page in asp.net ?
I have been tried by http module begin request and end request difference time span in response.write method, but after display request process time in aspx page my web application was hanged. Screen other functionality was hanged not working.
can any one please tell me how can we display request process time in asp.net web application i tried .net 3.5 / IIS 7.5 integrated mode
Upvotes: 0
Views: 1238
Reputation: 30727
Your question is really difficult to understand - in terms of what your trying to fully achieve.
I tried to break it down, and am assuming you just want to know how to calculate how long a process took to run.
If that's the case, then this will work - we get the Now.Ticks
are the start and also at the end and then convert them into seconds.
In VB
Dim tStart As Long = Now.Ticks
'' Do processing
Dim tEnd As Long = Now.Ticks
Dim tTaken As String = "Time taken " + TimeSpan.FromTicks(tEnd - tStart).TotalSeconds.ToString()
And in C#
long tStart = Now.Ticks;
// Do processing
long tEnd = Now.Ticks;
string tTaken = "Time taken " + TimeSpan.FromTicks(tEnd - tStart).TotalSeconds.ToString();
Upvotes: 1