Monitoring performance in ASP

Often when you're developing script, you may want to determine
just how fast the code takes to run. To do so, take advantage of
ASP's built-in Timer function. As you may know, this function
returns the number of seconds since midnight. To use this
function, capture the current value before your script runs,
then again afterwards, and compare the two. While this
method can vary depending on processor speeds, it provides
a decent benchmark.

<body>
<% myStart = timer %>
<b>Start: <%= myStart%></b>
<br/>
<% For x = 1 to 1000 
set myObj = Server.CreateObject("ADODB.Recordset")
set myObj = nothing
Next
myEnd = timer
%>
<b>End: <%=myEnd%></b>
<br/>
<b>Ellapsed Time: <%= myEnd - myStart %> (seconds)</b>
</body>

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr