Version 1.00
ASPTime is a stop-clock component for use in ASP pages. It also includes a pause function to pause between events. Keep a look out for updates at www.cs.niu.edu/~z951259/comlinks.html. Thank you for using ASPTime.- Manohar Kamath
Note: The ASPTime component is free. Please use it and distribute it as you like. However, there is no support for the component and you are responsible for the usage of the component. If you have any comments or suggestions, please email me at mkamath@niu.edu
Using ASPTime
- First, you will have to register the dll with the server. You can do this using the regsvr32.exe via the File manager or command line
regsvr32 ASPTime.dll- In the ASP Page where you like to use the component, create a Time object, as:
Set X = Server.CreateObject("ASPTime.Time")- Now you can use the functions and properties within the object by referencing them with the X object
Example:
<%
' Create an instance of Time Class
Set X = Server.CreateObject("ASPTime.Time")
' Start the stop-clock
X.Start()
'Your code goes here
.........
' Pause for 1.25 second
X.Pause(1.25)
' Stop the stop-clock
X.Stop()
' Print the TimeGap
Response.Write ("The code clocked " & X.TimeGap & " MilliSeconds")
%>
Function | Description | Examples |
Start () | Starts the stop-clock. | X.Start() |
Stop () |
Stops the clock. The TimeGap property will have the time interval between the stop and most recent Start() called. Within a page, You can stop however many times as you want. Each time you stop, the TimeGap property will have a corresponding interval value. Also, you can start the stop-clock as many times you want. Each time you do that, the TimeGap value will be cleared. |
X.Stop() |
Pause (Time) | Pauses or "Sleeps" for the given time. The Time is in seconds, and you can specify fractions of a second too.
The maximum pause time is 90 seconds. |
X.Pause(1.5) |
Properties | Description | Examples |
TimeGap | Returns the difference in time between the most recent Stop() and the corresponding Start() method in MilliSeconds. | X.TimeGap |
Copyright © 1997 Manohar Kamath.