Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Finding the Page Generation Time [modified]

Finding the Page Generation Time [modified]

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Woad
    wrote on last edited by
    #1

    :confused: How in Asp.Net can you find the amount of time it took to generate the page? I see this sort of stuff on the bottom of websites all the time. Code or a link to a tutorial would be greatly appreciated:) -- modified at 19:21 Wednesday 2nd August, 2006

    G K 2 Replies Last reply
    0
    • W Woad

      :confused: How in Asp.Net can you find the amount of time it took to generate the page? I see this sort of stuff on the bottom of websites all the time. Code or a link to a tutorial would be greatly appreciated:) -- modified at 19:21 Wednesday 2nd August, 2006

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can't, really. You can get the execution time of part of the generation process, but not the whole. However, that is probably what the others that you saw does anyway. What you can't measure is the compilation and creation of the page object, and the rendering of the page. The compilation takes about three seconds for the first page, and the time used for object creation and page rendering doesn't vary very much, so it's not very interresting anyway. Get the current time as early in the page creation process as you can, like in the PreInit or Init event. Then get the current time as late as possible while you still can put anything in the page, like in the PreRender event. Subtract the times and put the result in the page.

      --- b { font-weight: normal; }

      W 1 Reply Last reply
      0
      • G Guffa

        You can't, really. You can get the execution time of part of the generation process, but not the whole. However, that is probably what the others that you saw does anyway. What you can't measure is the compilation and creation of the page object, and the rendering of the page. The compilation takes about three seconds for the first page, and the time used for object creation and page rendering doesn't vary very much, so it's not very interresting anyway. Get the current time as early in the page creation process as you can, like in the PreInit or Init event. Then get the current time as late as possible while you still can put anything in the page, like in the PreRender event. Subtract the times and put the result in the page.

        --- b { font-weight: normal; }

        W Offline
        W Offline
        Woad
        wrote on last edited by
        #3

        Okay thanks Guffa, I'll try doing something with that.

        1 Reply Last reply
        0
        • W Woad

          :confused: How in Asp.Net can you find the amount of time it took to generate the page? I see this sort of stuff on the bottom of websites all the time. Code or a link to a tutorial would be greatly appreciated:) -- modified at 19:21 Wednesday 2nd August, 2006

          K Offline
          K Offline
          kiran kumar Intelligroup
          wrote on last edited by
          #4

          what ever guffa said is the better but slight change is save the current time in page on_init() time1 page_render() time2 procestime = time2-time1 then u will get absolute processtime

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups