Description: This function returns an array profiling the execution of statements in the application.
Returns: Array – see comments
Usage: Script
Format: Profile(StartStop)
Parameters: StartStop { numeric } { required } { no default: }
A numeric value of 0 or 1 that toggles the function on or off. A value of 1 causes the function to begin profiling the system, while a value of 0 stops the profiling and causes the return value to be set.
Comments: This function returns a two-dimensional array with each column representing a different statement and each row containing the following information:
|
Row |
Data |
|
0 |
Count of a statement |
|
1 |
Statement value |
|
2 |
Approximate execution time of statement in milliseconds |
It is important to note that in the case of a script executed by a trigger statement, the sum of the execution times for the script statements may be less than the execution time recorded for the trigger statement. This is because the script statements may be of sufficient duration to lose their processor time-slice and be suspended for a short time. While the suspended statement will have its timings adjusted to account for this, the trigger statement will not have any adjustments made.
Example:
If MatchKeys(2, "g");
[
Profile(1);
]
If MatchKeys(2, "s");
[
whatHappened = Profile(0);
]
These two scripts start and stop the profiling when the user presses the appropriate keys.
See Also: