We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 29,034 times

Related Categories

Determine execution time in ASP

Lio_889

This is a very simple and neat script that allows you to determine the time (in Milli seconds) required to execute the code in an ASP page.

<script language=jscript runat=server>
function GetTime()
{
   var d = new Date();
   return d.getTime();
}
</script>

<%
   Dim StartTime, EndTime
   StartTime = GetTime()
   ' Do some stuff
   EndTime = GetTime()
   
   Response.Write "Process took: " & Cstr(EndTime - StartTime) & " MilliSeconds."
%>

Comments

  • Asp Execution

    Posted by bootlicker on 05 Jan 2005

    You will get a type mismatch error if you Dim GetTime. It's a function, not a variable.

  • ASP Execution time

    Posted by baptistec on 17 Sep 2002

    You can also use the Timer() method and avoid the switch from JS to VBS...

    dim StartTime : StartTime = Timer()


    ... CODE GOES HERE ...

    Response.write(Timer() - StartTime)