PLVtmr: Analyzing Program Performance

Contents:
Toggling the Timer
Capturing the Start Time
Retrieving and Displaying the Elapsed Time
Using PLVtmr in Scripts

In Oracle PL/SQL Developing, I explored the implementation of the sp_timer package, which provides an easy-to-use interface to the DBMS_UTILITY.GET_TIME builtin function. GET_TIME gives us a mechanism for calculating the elapsed time of PL/SQL code execution down to the hundredth of a second. Since the publication of that tutorial, I have enhanced sp_timer and it has evolved into the PLVtmr (PL/Vision TiMeR) package. The following sections show how to use each of the different elements of PLVtmr. For more information about how this package was developed, see Oracle PL/SQL Developing.

Now you have the following options when analyzing PL/SQL performance:

Toggling the Timer

PLVtmr supplies a toggle so that you can leave your timing program calls in your code, but only have the timings execute when desired.

To turn on the activity of PLVtmr, call the turn_on program; its header is:

PROCEDURE turn_on;

To turn off the activity of PLVtmr, call the turn_on program; its header is:

PROCEDURE turn_off;

When turned off, PLVtmr will not add any overhead to your code execution and will not display any timing information.