Skip to content

Commit

Permalink
Merge pull request joyfullservice#441 from hecon5/clsPerformanceUpdates
Browse files Browse the repository at this point in the history
Updating clsPerformance, as some objects never restart timing, and wh…
  • Loading branch information
joyfullservice authored Oct 19, 2023
2 parents 1cda774 + b1af656 commit b418a54
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Version Control.accda.src/dbs-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Type": 10
},
"AppVersion": {
"Value": "4.0.22",
"Value": "4.0.24",
"Type": 10
},
"Auto Compact": {
Expand Down
46 changes: 41 additions & 5 deletions Version Control.accda.src/modules/clsPerformance.cls
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Attribute VB_Exposed = False
' : microsecond level. For additional details, see the following link:
' : http://www.mendipdatasystems.co.uk/timer-comparison-tests/4594552971
'---------------------------------------------------------------------------------------

Option Compare Database
Option Explicit

Expand Down Expand Up @@ -96,6 +97,18 @@ Public Property Get CallStack() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : CurrentCategoryName
' Author : hecon5
' Date : 10/3/2023
' Purpose : Return the current category name.
'---------------------------------------------------------------------------------------
'
Public Property Get CurrentCategoryName() As String
CurrentCategoryName = this.CategoryName
End Property


'---------------------------------------------------------------------------------------
' Procedure : CategoryStart
' Author : Adam Waller
Expand All @@ -105,15 +118,15 @@ End Property
'
Public Sub CategoryStart(strName As String)
If Not Me.Enabled Then Exit Sub
If this.CategoryName <> vbNullString Then CategoryEnd
If this.Categories Is Nothing Then Set this.Categories = New Dictionary
If this.CategoryName <> vbNullString Then CategoryEnd
StartTimer this.Categories, strName
this.CategoryName = strName
End Sub


'---------------------------------------------------------------------------------------
' Procedure : ComponentEnd
' Procedure : CategoryEnd
' Author : Adam Waller
' Date : 11/3/2020
' Purpose : End the timing of the active component
Expand Down Expand Up @@ -199,12 +212,26 @@ Public Sub OperationEnd(Optional lngCount As Long = 1)
this.OperationName = vbNullString
End If
End With
Else
this.OperationName = vbNullString
End If
End If

End Sub


'---------------------------------------------------------------------------------------
' Procedure : CurrentOperationName
' Author : hecon5
' Date : 10/3/2023
' Purpose : Return the current operation's name.
'---------------------------------------------------------------------------------------
'
Public Property Get CurrentOperationName() As String
CurrentOperationName = this.OperationName
End Property


'---------------------------------------------------------------------------------------
' Procedure : DigitsAfterDecimal
' Author : Eugen Albiker
Expand Down Expand Up @@ -260,7 +287,9 @@ End Function
'---------------------------------------------------------------------------------------
'
Private Sub StartTimer(dItems As Dictionary, strName As String)

Dim cItem As clsPerformanceItem

If Not dItems.Exists(strName) Then
Set cItem = New clsPerformanceItem
dItems.Add strName, cItem
Expand Down Expand Up @@ -331,6 +360,9 @@ Public Sub ResumeTiming()
' Resume current operation
If this.OperationName <> vbNullString Then StartTimer this.Operations, this.OperationName

' Resume current Category
If this.CategoryName <> vbNullString Then StartTimer this.Categories, this.CategoryName

End Sub


Expand Down Expand Up @@ -484,8 +516,10 @@ End Function
' : e 12 3.23
'---------------------------------------------------------------------------------------
'
Private Function ListResult(strHeading As String, strResult1 As String, strResult2 As String, _
lngCol() As Long) As String
Private Function ListResult(strHeading As String, _
strResult1 As String, _
strResult2 As String, _
lngCol() As Long) As String

Dim strRowHeading As String
Dim lngPos As Long
Expand Down Expand Up @@ -527,7 +561,9 @@ End Function
' Purpose : Pads a string
'---------------------------------------------------------------------------------------
'
Private Function PadRight(strText As String, lngLen As Long, Optional lngMinTrailingSpaces As Long = 1) As String
Private Function PadRight(strText As String, _
lngLen As Long, _
Optional lngMinTrailingSpaces As Long = 1) As String

Dim strResult As String
Dim strTrimmed As String
Expand Down

0 comments on commit b418a54

Please sign in to comment.