Pertama kali saya menulis kelas ASP, Menerapkan Fungsi: Waktu Eksekusi Program Statistik Disegmentasi, Tabel Statistik Output, dll.
Salinan kode adalah sebagai berikut:
ClassccclsProcessTimerecorder
'Penulis Program: MingyuexingGuang
'Beranda Penulis: http://www.5iya.com/blog
'http://www.kuozhanming.com
'ASP Program Execution Time Statistics Class
Privateccinti, ccintnoncetime, ccintdecimal
PrivateccintStarttime, CCINTENDTIME, CCINTNOW, CCINTNONCE
PrivateccStrinterval, CCSTREVENT, CCSTRTIME, CCSTRSTATISTICLOG, CCSTRFORMATITERVAL
PrivatecCarrevent, Ccarrtime
Privatesubclass_initialize
CCStrinterval = "|" 'Pembatas default
ccintdecimal = 4'number angka setelah titik desimal
ccstrevent = ""
ccstrtime = ""
ccStrformAtInterval = "<br/>" & vbcrlf
ccintstarttime = timer
ccintnow = ccintstarttime
ccintnonce = ccintstarttime
Endsub
PublicSubRecord (CCSTREVENTNAME)
ccStrevent = ccStrevent & ccStrinterval & ganti (ccStreventName, ccStrinterval, "")
ccstrtime = ccstrtime & ccstrinterval & formatnumber (timer-ccintnow, ccintdecimal, true, false, true)
ccintnow = timer
Endsub
PublicPropertyletFormat (ccstrformattype)
Iflcase (trim (ccstrformattype)) = "html" lalu
ccStrformAtInterval = "<br/>" & vbcrlf
Kalau tidak
ccStrformAtInterval = vbcrlf
Endif
Endproperty
PublicFunctionStatistik
Ifinstr (ccStrevent, ccStrinterval)> 0then
ccintendtime = timer
ccarrevent = split (ccstrevent, ccstrinterval)
ccarrtime = split (ccstrtime, ccstrinterval)
CCSTRSTATISTIKLOG = CCSTRSTATISTICLOG & "ProcessTimerecord" & CCSTRFORMATIVERIVAL
CCSTRSTATISTICLOG = CCSTRSTATISTICLOG & "--------------------------------------" & CCSTRFORMATIVERIVAL