1 - On your asp page set blnDebug = true
2 - call StartTimer anywhere in the code you want to begin timing.
3 - call StopTimer anywhere you want to end timing.
4 - call OutputTimer to see the results
Dim timerTime
Dim timerOutput
Dim totalElapsedTime
Dim blnDebug
Dim totalTime
totalTime = Timer
'******************************************************
'Name: startTimer
'Parameters: strMessage
'Return:
'Description: Function to start a Timer before a process starts. This must be used in conjunction
' with stopTimer after the process is complete
'******************************************************
Function startTimer(strMessage)
If blnDebug Then
timerTime = Timer
End If
End Function
'**********************************************************''Name: stopTimer
'Parameters: strMessage
'Return:
'Description: Function to stop a Timer after a process is complete. This must be used in conjunction
' with startTimer before the process starts. The specific process name should be passed
' as a parameter to display the correct message
'********************************************************
Function stopTimer(strMessage)
If blnDebug Then
timerTime = Timer - timerTime
timerOutput = timerOutput & "<tr><td>Elapsed Time for " & strMessage & ":</td><td><b>" & timerTime & " sec.</b></td></tr>"
totalElapsedTime = totalElapsedTime + timerTime
End If
End Function
'******************************************************
'Name: outputTimer
'Parameters: none
'Return:
'Description: Function to ouptut timings set throughout the request blnDebug is set to true
'******************************************************
Function outputTimer()
If blnDebug Then
timerOutput = timerOutput & "<tr><td><b>Elapsed Time for selected processes: </b></td><td><b>" & totalElapsedTime & " sec.</b></td></tr>"
timerOutput = timerOutput & "<tr><td>Miscellaneous process Time: </td><td><b>" & ((Timer - totalTime) - totalElapsedTime) & " sec.</b></td></tr>"
timerOutput = timerOutput & "<tr><td><b>Total Page Execution Time: </b></td><td><b>" & (Timer - totalTime) & " sec.</b></td></tr>"
timerOutput = timerOutput & "<tr><td><b>Test Date & Time: </b></td><td><b>" & now() & " </b></td></tr>"
Response.write "<table>" & timerOutput & "</table>"
End If
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.