display time needed for creation of the page

Discussion in 'ASP .Net' started by =?Utf-8?B?WGF2aWVy?=, Feb 9, 2006.

  1. 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
     
    =?Utf-8?B?WGF2aWVy?=, Feb 9, 2006
    #1
    1. Advertising

  2. 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.

    "Xavier" <> wrote in message
    news:...
    > 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
     
    Peter Rilling, Feb 9, 2006
    #2
    1. Advertising

  3. 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.


    "Xavier" <> wrote in message
    news:...
    > 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
     
    Rob R. Ainscough, Feb 9, 2006
    #3
  4. 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.

    "Rob R. Ainscough" <> wrote in message
    news:...
    > 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.
    >
    >
    > "Xavier" <> wrote in message
    > news:...
    >> 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

    >
    >
     
    George Ter-Saakov, Feb 9, 2006
    #4
  5. 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

    "George Ter-Saakov" wrote:

    > 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.
     
    =?Utf-8?B?WGF2aWVy?=, Feb 9, 2006
    #5
  6. 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.


    "Xavier" <> wrote in message
    news:...
    > 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
    >
    > "George Ter-Saakov" wrote:
    >
    >> 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.

    >
     
    George Ter-Saakov, Feb 9, 2006
    #6
  7. yes for 2.0 it's perfect to use.
    thanks for your help.

    "George Ter-Saakov" wrote:

    > 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.
    >
    >
    > "Xavier" <> wrote in message
    > news:...
    > > 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
    > >
    > > "George Ter-Saakov" wrote:
    > >
    > >> 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.

    > >

    >
    >
    >
     
    =?Utf-8?B?WGF2aWVy?=, Feb 9, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pekka Niiranen
    Replies:
    4
    Views:
    322
    Edward C. Jones
    Jun 19, 2004
  2. flamesrock
    Replies:
    8
    Views:
    471
    Hendrik van Rooyen
    Nov 24, 2006
  3. Frank Millman
    Replies:
    23
    Views:
    632
    Steven D'Aprano
    Jun 13, 2007
  4. Fabrizio
    Replies:
    2
    Views:
    179
    Dr John Stockton
    Oct 5, 2004
  5. Mel
    Replies:
    2
    Views:
    209
    Grant Wagner
    Jan 20, 2005
Loading...

Share This Page