La première fois que j'écris une classe ASP, implémente les fonctions: temps d'exécution du programme de statistiques segmentées, tableau des statistiques de sortie, etc.
La copie de code est la suivante:
CLASSCCCLSPROCESSTIMERECORDER
'Auteur du programme: MingyuexingGuang
'Page d'accueil de l'auteur: http://www.5iya.com/blog
'http://www.kuozhanming.com
«Classe de statistiques de temps d'exécution du code ASP du programme
Privateccinti, ccintnoncetime, ccintdecimal
Privateccintstarttime, ccintendtime, ccintnow, ccintnonce
PrivateccstRerval, ccStRevent, ccstrtime, ccStStatisticLog, ccStrformatiterval
Privateccarrevent, ccarrtime
PrivésubClass_Initialize
ccStRinterval = "|" 'Default Demiter
CCINTDECIMAL = 4'NUMBER DE DIMITS APRÈS Point décimal
CCSTERVENT = ""
ccstrtime = ""
ccStFormatiterval = "<br/>" & vbcrlf
CCIntStartTime = Timer
ccintnow = ccintstarttime
ccintnonce = ccintstarttime
Fin
PublicsubRecord (CCSTREVENTNAME)
CCSTREVENT = CCSTERVENT & CCSTRINTERVAL & REPLACE (CCSTERVENTNAM
ccstrtime = ccstrtime & ccstrinterval & formatNumber (Timer-cintNow, ccintDecimal, true, false, true)
ccintnow = minuterie
Fin
PublicPropertyletFormat (CCSTRORTFormatType)
IflCase (Trim (ccStRormatType))) = "html" puis
ccStFormatiterval = "<br/>" & vbcrlf
Autre
CCSTRORTHALATINTERVAL = VBCRLF
Endire
Endproperty
PublicFunctionstatistic
IFinstr (ccStRevent, ccStRinterval)> 0THEN
ccintendtime = temporisateur
ccarRevent = Split (CCSTERVENT, CCSTRINTERVAL)
CCarrtime = Split (CCStrtime, CCSTRINTERVAL)
CCSTRSTATISTISTISTLOG = CCSTRSTATISTISTIQUE & "ProcessImmeRecord" & CCSTRORTFormatiterval
CCSTRSTATISTISTISTLOG = CCSTRSTATISTISTLOG & "--------------------------------------" & CCSTRORTformatiterval