Is there a precise timer available in ASP ??

Results 1 to 6 of 6

Thread: Is there a precise timer available in ASP ??

  1. #1
    Lodewijk Guest

    Default Is there a precise timer available in ASP ??

    Hi,<BR>I want to measure the improvement of my script, but I only can measure in seconds... (with the Now command..). I want to measure more accurately, in milliseconds if possible. Is there a way to do this ??<BR>:) Lo

  2. #2
    Diederik Stenvers Guest

    Default RE: Is there a precise timer available in ASP ??

    If i&#039m not mistaking you can use request.waittime and request.executing <BR><BR>see http://msdn.microsoft.com/workshop/server/asp/aspatoz.asp

  3. #3
    Steve Marlowe Guest

    Default RE: Is there a precise timer available in ASP ??

    maybe it is just me...but i am having a hard time finding any information about response.waittime and response.executing like you mentioned. maybe you could provide a more specific web address or other reference?<BR><BR>steve

  4. #4
    Join Date
    Dec 1969
    Posts
    1,912

    Default RE: Is there a precise timer available in ASP ??

    Have you tried the Timer() function? I believe it calculates time based on the number of milliseconds since midnight (not by seconds as stated in the docs). Try the code below:<BR><BR>&#060;%<BR>Option Explicit<BR><BR>Dim StartTime<BR>Dim EndTime<BR>Dim ElapsedTime<BR>Dim i<BR><BR>StartTime = Timer()<BR><BR>&#039--- Code to measure goes here ----<BR>For i = 1 to 30000<BR> Response.Write ""<BR>Next<BR><BR>EndTime = Timer()<BR><BR>ElapsedTime = EndTime - StartTime<BR><BR>Response.Write ElapsedTime<BR><BR>%&#062;


  5. #5
    Join Date
    Dec 1969
    Posts
    31

    Default RE: Is there a precise timer available in ASP ??

    they are not asp methods but names of parameters that you can monitor with System Monitor on NT

  6. #6
    Jon Banta Guest

    Default RE: Is there a precise timer available in ASP ??

    There is a object called ASPTime that does just this. Download it at: http://www.kamath.com/downloads/<BR><BR>A sample pice of code:<BR><BR> Dim X, ReturnTime<BR><BR>&#039=========================== ===============================<BR>Sub TimerStart()<BR><BR> Set X = Server.CreateObject("ASPTime.Time")<BR> X.Start()<BR>End Sub<BR>&#039====================================== ====================<BR>Function TimerStopReturnTime()<BR> X.Stop()<BR> ReturnTime = X.TimeGap<BR> set X = Nothing <BR>End Function<BR>&#039================================= =========================<BR><BR> TimerStart &#039Start Timer<BR><BR>&#039Place your code here<BR><BR> TimerStioReturnTime &#039Stop Timer<BR><BR> &#039Write time gap in milliseconds<BR> Response.write ReturnTime<BR><BR>P.S. You can also stall the timer with .Pause(time in seconds)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •