How can I add that to the bottom of my pages in ASP...? I know u can do it in PHP, so how can I do that in ASP? (I'm using mySQL)
| SitePoint Sponsor |



How can I add that to the bottom of my pages in ASP...? I know u can do it in PHP, so how can I do that in ASP? (I'm using mySQL)
"Sometimes little is more."
Kamran A
Web Dev/Designer
Keyboard not found: Please Press F1 to Continue
There's no built-in method to do this in ASP like there is in PHP so you'll have to fake it. It would probably go something like this:Originally posted by SubKamran
How can I add that to the bottom of my pages in ASP...? I know u can do it in PHP, so how can I do that in ASP? (I'm using mySQL)
[vbs]
dim count, query(50), date1, date2, difference
'Get current time pre-queries
date1 = date(now)
'loop thru all queries
for x = 0 to [number of queries]
query(x)= [SQL Query Here]
next
'Get current time post-queries
date2 = date(now)
'Get time to execute
difference = DateDiff("s", date1, date2)
'count of queries
count = x
'output to browser
response.write("Page generated in " & difference & " seconds, " & count & " queries executed.")
[/vbs]
That should help! The timing is for query execution but if you put the date1 and date2 variables at the beginning and end of what you want to time, respectively, you should get the result you want.
--Vinnie



Here is a discussion on Script timing found at 4guysfromrolla:
http://www.4guysfromrolla.com/webtech/122799-1.shtml
One article linked to it suggested the date difference method, was not as accurate (something to do with the level of measurement).
From what I gathered when I researched this before, there is little that can be done to get very accurate times except for longer executing scripts or running multiple iterations.
Best Regards.
worksdev


I use this code that I found somewhere
Code:<% dtBegin = timer (code here) dtEnd = timer sProcessingTime = formatnumber(dtEnd - dtBegin, 2) %>
Keomed.com Webmaster
www.keomed.com



Nah...it's OK, I won't go through the trouble...
Btw, Hideki, the weather here (MN) sux doesn't it? One day it's 90 degrees, and the next it's a storm! GRRR!
"Sometimes little is more."
Kamran A
Web Dev/Designer
Keyboard not found: Please Press F1 to Continue


No Sh$t....and before you know it the leaves are falling and it's winter!
Gonna go water skiing now. Hopefully it won't rain like it did the last 3 days. Where's newsbyteens based from?
The script above is very simple. Just stick it at the very top and very bottom of your page.
Keomed.com Webmaster
www.keomed.com
Bookmarks