display time needed for creation of the page

G

Guest

hello,

what is the best way to display display the time needed for rendering the
information. I must get the difference of time from the start of rendering
till the finish rendering the page - but any ideas how to do it?

My customer want to have such a info on every page, somthing like 0,12 sek

best regards
 
P

Peter Rilling

Well, you could record the time in the Page_Init and also in the
Page_PreRender and then in the Page_PreRender, change a label that you might
have so that it's text contains the difference between the two times.
 
R

Rob R. Ainscough

Hard to do with ASP 1.1 or 2.0 as the first time it renders is much slower
than subsequent times so your data will be misleading. You might want to do
an average over some predefined session of multiple pages.
 
G

George Ter-Saakov

Answer to Xavier:

Not sure where problem is.
Just do it.
First line in HTML.

<%
long l1 = DateTime.Now.Ticks;
%>

Last line
<%
long l2 = DateTime.Now.Ticks;
Response.Write( (l2-l1)/1000);
%>


George.
 
G

Guest

thanks for your replay.
My problem is - how can i simply add such a feature in a simply way to all
pages. I think something like create a new class inherited from a page ....
and then all aspx pages of the site should be inherited from this new class
.....

I did not know if this is a possible or a good concept. I did not want to
implement in each codebehind of every page manually the necesary code

Any ideas, is this possible?
thanks
 
G

George Ter-Saakov

Really depends on your design.
The Master pages design is perfect. Then all you have to do is to change
the master page and all your pages would be changed.

Is you do not have that design then you need to go and touch every aspx
page. Since you need to modify HTML anyway to display that information.


George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top