Library code snippets
Determine execution time in ASP
By Lio_889, published on 22 Feb 2002
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."
%>
Related articles
Related discussion
-
Calling a function from ASP code
by dunk00 (3 replies)
-
GridView HyperLinkField Problem
by Paul2 (0 replies)
-
looking for help on asp
by cladironbeard (2 replies)
-
simple vb to c#, help please
by lksath (1 replies)
-
Binary Studio | software development outsourcing Ukraine
by Hexfinity (2 replies)
Related podcasts
-
Scott Guthrie
Scott catches up with Scott Guthrie in an interview covering Ajax, Asp 2.0, extender controls, CSS adapters and more.
Events coming up
-
Aug
27
Model-View-Presenter (MVC) in ASP.NET
San Francisco, United States
Model-View-Presenter (MVC) in ASP.NET Presenter Clayton Peddy, Terrace Software, Inc. Details TBD
You will get a type mismatch error if you Dim GetTime. It's a function, not a variable.
dim StartTime : StartTime = Timer()
... CODE GOES HERE ...
Response.write(Timer() - StartTime)
This thread is for discussions of Determine execution time in ASP.