Public Enum ptLevels

    • ptLevelNone    
    • ptLevelLow
    • ptLevelMedium
    • ptLevelHigh
    • ptLevelAll

purpose

These are given  when creating a cProcProfiler or starting a cProcTimer. They allow you to filter which sections to include in a profile session without having to change your code. A cProcProfiler created with a level of ptLevelNone will not do any profiling at all -essentially disabling profiling but allowing the code to remain.
' create defaultprofiler, and start
    Call procProfilerConstruct(, ptLevelNone)
    '
    ' ... some code
    '

One created with ptLevelAll will report on all sections.

' create defaultprofiler, and start
    Call procProfilerConstruct(, ptLevelAll)
    '
    ' ... some code
    '

Lets say we were to create a profiler with ptLevelMedium

 ' create defaultprofiler, and start
    Call procProfilerConstruct(, ptLevelMedium)
    '
    ' ... some code
    '

This would cause only sections with a level of ptLevelLow and ptLevelMedium to be processed, omitting those with ptLevelHigh

' create defaultprofiler, and start
    Call procProfilerConstruct(, ptLevelMedium)
    '
    ' ... some code
    '
    Call procProfiler.Start("I will be processed", "example Profile", ptLevelLow)
    '
    Call procProfiler.Start("So will I", "example Profile", ptLevelMedium)
    '
    Call procProfiler.Start("I will not be processed", "example Profile", ptLevelHigh)

Notes

Using ptLevels allows you to leave profiler code in place and control its execution from just one place when you create the profiler in the first place

For help and more information join our forum, follow the blog or follow me on Twitter