Diagnostics and Benchmark Helpers - danielep71/VBA-PERFORMANCE_MANAGER GitHub Wiki

Diagnostics and Benchmark Helpers

This page explains the diagnostic and benchmark-oriented members of cPerformanceManager.

These members are not the primary timing workflow. They are the secondary analysis surface of the class: they help you inspect timer characteristics, estimate measurement cost, and understand the environment in which your timings are running.

Members covered here

  • OverheadMeasurement_Seconds
  • OverheadMeasurement_Text
  • Get_SystemTickInterval
  • QPC_Get_SystemTickInterval
  • QPC_FrequencyPerSecond
  • QPC_FrequencyPerSecond_Value

Measurement overhead helpers

OverheadMeasurement_Seconds

Returns a numeric estimate of average near-empty measurement overhead in seconds.

OverheadS = cPM.OverheadMeasurement_Seconds([iMethod], [Iterations])

OverheadMeasurement_Text

Returns a human-readable report of average near-empty measurement overhead.

Debug.Print cPM.OverheadMeasurement_Text([iMethod], [Iterations])

Timer-environment diagnostics

Get_SystemTickInterval

Returns the nominal system clock tick interval in milliseconds.

QPC_Get_SystemTickInterval

Returns the QPC tick interval in seconds per tick.

QPC_FrequencyPerSecond

Returns the QPC frequency as human-readable text.

QPC_FrequencyPerSecond_Value

Returns the QPC frequency as a numeric Double.

Practical diagnostic example

Option Explicit

Public Sub Example_DiagnosticsAndBenchmarkHelpers()

    Dim cPM          As cPerformanceManager
    Dim OverheadS    As Double

    Set cPM = New cPerformanceManager

    Debug.Print cPM.Get_SystemTickInterval
    Debug.Print cPM.QPC_Get_SystemTickInterval
    Debug.Print cPM.QPC_FrequencyPerSecond
    Debug.Print cPM.QPC_FrequencyPerSecond_Value

    OverheadS = cPM.OverheadMeasurement_Seconds(5, 1000)

    Debug.Print "Numeric overhead = " & Format$(OverheadS, "0.000000000")
    Debug.Print cPM.OverheadMeasurement_Text(5, 1000)

    cPM.ResetEnvironment
    Set cPM = Nothing

End Sub