How to show the refresh time of a web page

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I have a web page which show a lot of data, it waste a lot of time to show
the data.
I wnat to know how much time it take to show the data.
How can I get it?
 
You can use the StopWatch class or just set a DateTime field with
DateTime.Now at the very beginning of page processing (you pick the event you
want to start with) and then say, in Page_Unload, you would set a new
DateTime field to DateTime.Now. Take the timespan difference by subtracting
the first from the last, and get the TotalMilliseconds.
Of course, reading between the lines, this is only going to tell you
something you already know: your page is taking a long time to display data.
Better to investigate why this may be happening and work to create a more
efficient way to get what you want.
Peter
 
Ad,

Enable trace. It will help you to identify which place takes long time to
execute. Go to web.config file, put this
<trace enabled="true" pageOutput="true" requestLimit="1000"/>
under <system.web> section. (You can also use it from trace.axd utility page
when pageOutput is set to false)

Milosz Skalecki
MCAD
 
Back
Top