国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP程序代碼執行時間統計類

2024-05-04 10:59:08
字體:
來源:轉載
供稿:網友
第一次寫ASP類,實現功能:分段統計程序執行時間,輸出統計表等.
復制代碼 代碼如下:

Class ccClsProcessTimeRecorder
'程序作者:明月星光
'作者主頁:http://www.5iya.com/blog
'http://www.kuozhanming.com
'ASP程序代碼執行時間統計類

  Private ccInti,ccIntNonceTime,ccIntDecimal
  Private ccIntStartTime,ccIntEndTime,ccIntNow,ccIntNonce
  Private ccStrInterval,ccStrEvent,ccStrTime,ccStrStatisticLog,ccStrFormatInterval
  Private ccArrEvent,ccArrTime

  Private Sub Class_Initialize
    ccStrInterval = "|"  '默認分隔符
    ccIntDecimal = 4    '小數點后位數
    ccStrEvent = ""
    ccStrTime = ""
    ccStrFormatInterval = "<br />" & vbCrLf
    ccIntStartTime = Timer
    ccIntNow = ccIntStartTime
    ccIntNonce = ccIntStartTime
  End Sub

  Public Sub Record(ccStrEventName)
    ccStrEvent = ccStrEvent & ccStrInterval & Replace(ccStrEventName,ccStrInterval,"")
    ccStrTime = ccStrTime & ccStrInterval & FormatNumber(Timer-ccIntNow,ccIntDecimal,True,False,True)
    ccIntNow = Timer
  End Sub

  Public Property Let Format(ccStrFormatType)
    If LCase(Trim(ccStrFormatType)) = "html" Then
      ccStrFormatInterval = "<br />" & vbCrLf
    Else
      ccStrFormatInterval = vbCrLf
    End If
  End Property

  Public Function Statistic
    If InStr(ccStrEvent,ccStrInterval) > 0 Then
      ccIntEndTime = Timer
      ccArrEvent = Split(ccStrEvent,ccStrInterval)
      ccArrTime = Split(ccStrTime,ccStrInterval)
      ccStrStatisticLog = ccStrStatisticLog & "Process Time Record" & ccStrFormatInterval
      ccStrStatisticLog = ccStrStatisticLog & "--------------------------------------" & ccStrFormatInterval
      For ccInti = 1 To UBound(ccArrEvent)
        ccStrStatisticLog = ccStrStatisticLog & ccArrEvent(ccInti) & " : " & ccArrTime(ccInti) & " s" & ccStrFormatInterval
      Next
      ccStrStatisticLog = ccStrStatisticLog & "--------------------------------------" & ccStrFormatInterval
      ccStrStatisticLog = ccStrStatisticLog & "Total : " & FormatNumber(ccIntEndTime-ccIntStartTime,ccIntDecimal,True,False,True) & " s"
      Statistic = ccStrStatisticLog
    Else
      Statistic = "No Record"
    End If
  End Function
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴青县| 五华县| 辽宁省| 吉安县| 民丰县| 习水县| 温宿县| 甘孜| 西吉县| 襄垣县| 西安市| 英山县| 曲松县| 石嘴山市| 盐亭县| 汉沽区| 贵南县| 东乡族自治县| 札达县| 雷波县| 芜湖市| 府谷县| 若尔盖县| 伽师县| 辉南县| 大埔县| 平罗县| 锡林浩特市| 巴彦淖尔市| 莎车县| 柯坪县| 丁青县| 威远县| 阳春市| 贵德县| 林口县| 定安县| 南木林县| 揭阳市| 嘉峪关市| 香港 |