ครั้งแรกที่ฉันเขียนคลาส ASP ใช้ฟังก์ชั่น: เวลาดำเนินการโปรแกรมสถิติแบ่งส่วนตารางสถิติเอาท์พุท ฯลฯ
การคัดลอกรหัสมีดังนี้:
classccclsprocesstimerecorder
'โปรแกรมผู้เขียน: MingyuexingGuang
หน้าแรกของผู้แต่ง: http://www.5iya.com/blog
'http://www.kuozhanming.com
คลาสสถิติการดำเนินการรหัสเวลาการดำเนินการรหัส ASP
privateCcinti, ccintnoncetime, ccintdecimal
PrivateCcintStartTime, Ccintendtime, Ccintnow, Ccintnonce
privateCcstrinterval, ccstrevent, ccstrtime, ccstrstatisticlog, ccstrformatinterval
PrivateCcarrevent, ccarrtime
Privatesubclass_initialize
ccstrinterval = "|" 'คั่นเริ่มต้น
ccintdecimal = 4'number of Digits หลังจากจุดทศนิยม
ccstrevent = ""
ccstrtime = ""
ccstrformatInterval = "<br/>" & vbcrlf
ccintStartTime = ตัวจับเวลา
ccintnow = ccintStartTime
ccintnonce = ccintStartTime
enddub
Publicsubrecord (ccstreventName)
ccstrevent = ccstrevent & ccstrinterval & แทนที่ (ccstreventName, ccstrinterval, "")
ccstrtime = ccstrtime & ccstrinterval & formatnumber (timer-mcintnow, ccintdecimal, true, false, true)
ccintnow = ตัวจับเวลา
enddub
PublicPropertyLetFormat (CCSTROFFORMATTYPE)
iflcase (trim (ccstrformattype)) = "html" แล้ว
ccstrformatInterval = "<br/>" & vbcrlf
อื่น
ccstrformatInterval = vbcrlf
endif
ปลายทาง
นักเขียนบทกวี
ifinstr (ccstrevent, ccstrinterval)> 0 แล้ว
ccintendtime = ตัวจับเวลา
ccarrevent = split (ccstrevent, ccstrinterval)
ccarrtime = split (ccstrtime, ccstrinterval)
ccstrstatisticlog = ccstrstatisticlog & "processtimerecord" & ccstrformatinterval
ccstrstatisticlog = ccstrstatisticlog & "------------------------------" & ccstrformatinterval