Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Time keeps on slipping

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-05 : 09:36:27
...Steve Miller

A few of my form pages are slowing down, or it may be my imagination. There are several stored procedures called on each page:
- Header info
- Footer summary stats
- 3 dropdowns
- Usually one other

I'm thinking of adding an OUTPUT parameter to each proc which returns the execution time for that procedure. The ASP would write the time in an HTML comment


<!-- exec time: nnnn Ms -->

After each procedure call. I was wondering if anyone had done anything similar or if there's a better way to get a handle on where the time goes?

Sam

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-08-05 : 09:55:22
I've had to do something like that in the past.
I put time checks on the procs in SQL, but I found that it wasn't the SQL running longer.

SO I used vbscripts NOW() in the asp at various parts to narrow down the problem area.

It might not be that the query runs long, maybe the network is taking strain, maybe there is more data than normal being returned by the query so the dropdowns take longer to load.


Duane.
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-05 : 10:01:15
Well, NOW avoids modifying the stored procs. I suppose this is a solution with less programming...
Go to Top of Page

RoLYroLLs
Constraint Violating Yak Guru

255 Posts

Posted - 2004-08-08 : 23:40:37
Sometimes I also use NOW() in various places, and I also add the time the sp took to execute, just to see where time goes. Just an added time checker

- RoLY roLLs
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-09 : 10:15:12
I found TIMER() gave the resolution down to 1/100 sec. I couldn't get NOW() to do the job. ??
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-09 : 10:51:22
why doesn't this work for you??

declare @start datetime
declare @end datetime
set @start = getdate()
stuff to time...
set @end = getdate()
select @end - @start

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-09 : 10:54:46
'cause the discussion is about how to do it in ASP
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2004-08-10 : 06:49:35
"This page was generated in 0.14 seconds" This is what I got when opening this post...says so on the bottom of the page. To create such a thing do this:

<%
'This is the very top of you asp-page
Start = timer
%>
<!--Do all you asp/html-stuff-->
<%
'Then at the very bottom of your asp-page:
Elapsed = timer-Start
Response.Write("Page created in " & Elapsed & " seconds")
%>

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page
   

- Advertisement -