Das erste Mal, dass ich eine ASP -Klasse schreibe, Funktionen implementieren: Segmentierte Statistikprogrammausführungszeit, Ausgangsstatistik Tabelle usw.
Die Codekopie lautet wie folgt:
ClassCCClSProcesTimeRecorder
'Programmautor: Mingyuexingguang
Homepage des Autors: http://www.5iya.com/blog
'http://www.kuozhanming.com
'ASP Programmcode Ausführungszeit Statistikklasse
Privateccinti, ccintnoncetime, ccintdecimal
Privateccintstarttime, ccintendtime, ccintnow, ccintnonce
Privateccstinterval, ccstrevent, ccstrime, ccstrstatisticLog, ccstrformatinterval
Privateccarrevent, ccarrtime
PrivateSubclass_initialize
ccstrinterval = "|" 'Standard -Abgrenzer
ccintdecimal = 4'number der Ziffern nach Dezimalpunkt
ccstrevent = ""
ccstrime = ""
CCStrformatInterval = "<br/>" & vbcrlf
ccintstartTime = timer
ccintnow = ccintstartTime
ccintnonce = ccintstartTime
Ende
PublicsuBRecord (ccstreventName)
ccstrevent = ccstrevent & ccstrinterval & ersetzen (ccstreventname, ccstrinterval, "")
ccstrime = ccstrime & ccstrinterval & formatnumber (timer-ccintnow, ccintdecimal, wahr, falsch, wahr)
ccintnow = timer
Ende
PublicPropertyletformat (ccstrFormattype)
IFLCase (Trim (ccstrFormattype)) = "html" dann
CCStrformatInterval = "<br/>" & vbcrlf
Anders
CCStrformatInterval = VBCRLF
Endif
Endproperschaft
PublicFunctionStatistic
IFInstr (CCstreVent, CcStrinterval)> 0Then
ccintendTime = timer
ccarrevent = split (ccstrevent, ccstrinterval)
ccarrtime = split (ccstrime, ccstrinterval)
ccstrstatisticLog = ccstrstatisticLog & "ProcessTimereCord" & ccstrFormatInterval
ccstrstatisticLog = ccstrstatisticLog & "----------------------------------" & ccstrFormatInterval