Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

processing time?

Status
Not open for further replies.

ryan010101

Technical User
Jan 24, 2001
83
US
I just want to display how long it took a page to process. For example on search engines it will say "search took .07 seconds". I'm assuming there is a server variable, but I can't find it.

thanks
 
this is fairly simple to do
all you need is to declare a var for the time
<% Dim starttime = now %>

now that you have that you have something to work against. Use the datadiff function to get the total time (in seconds I hope) for the start of the page and time it completed the load

<%=datediff(&quot;s&quot;,starttime,now) & &quot; seconds&quot;%>
what we did here was said = (short cut for response.write)
datediff in seconds between the var starttime which holds the value that the page was in a sense hit first and the time now.
so if the user entered at
starttime = 3:18:01
and then when the code for the datediff ran after the page loaded the main body etc.. was 3:18:03
your result will output (write) 2 seconds to the screen


hope that helps out Just a suggestion: faq183-874
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top