In a global location in your code you can reference the Performance Monitor object using early or late binding as shown.
In this example "pm" is the reference object variable but you can use any object variable name you wish.
Note: before you can use this early bound code you need to add the reference first.
The six Performance Monitor (pm) methods available:
pm.Start Name [, ParameterArray ]
Call when entering a block of code you wish to monitor
The Name is required while the ParameterArray is optional
[ pm.Log ParameterArray ]
Logging Data is entirely optional but must be called between a Start and a St0p. You can call Log as many times as you wish.
pm.St0p [, ParameterArray ]
In any block of code that you called Start, you must call St0p. Note that the '0' is a zero, not an 'o'.
Be very careful that you include a St0p at any part of the code that can exit else you will cause the trace to become mismatched which will cause the analysis to report issues.
The ParameterArray is optional
Note that you can call the Start and St0p methods multiple times inside of a sub or function if you want to measure performance inside of a sub or function.
This writes out the captured performance data into a .PAD file after your last St0p commend.
If you do not provide a Title you will be prompted for one to be entered as shown.
This will create the PAD file in your default folder as set in the configuration.
The name of the PAD file will be the same as the Title with a .PAD extension.
If you provide the optional File parameter then the PAD file will be created as specified.
The created PAD file is in a simple text format as shown below. The Analyzer loads this file to display its contents.
Note that the " | " and the " ~ " characters are used to delineate fields and thus cannot be used in any parameters.
You can temporally disable code monitoring by calling this. Make sure you do not call this in between a Start and a Stop.
You can turn back on code monitoring by calling this.
Note: Enable is always initially set by default.