%PerfTime system variable

Description

Use the %PerfTime system variable to return the application server's local system time.

This variable returns only the local system time. This is different from the %Time system variable, which returns the system time from the database server, which may or may not be the same physical system as the application server.

PeopleSoft recommends using %PerfTime when measuring performance time for a specific PeopleCode program. This can enable developers to evaluate which coding logic has better performance time.

Note:

Do not assume that %PerfTime returns the same time as the database server. Use %Time if you need to use a time value for your application transaction.

Example

The following is an example of how to use %PerfTime to check performance of a PeopleCode program:

&startTime = %PerfTime;

Local number &nbr;
Local Rowset &Table1_rs, &Table2_rs, &Table1_cpy_rs, &Table2_cpy_rs;
Local Rowset &Table1_vw_rs;
&Table1_rs = CreateRowset(Record.PTP_TABLE1);
&Table1_cpy_rs = CreateRowset(Record.PTP_TABLE1);
&Table1_rs.Fill("WHERE PTP_SEQ_NBR <= 10001");

REM
REM  Copy using Rowset function from one RowSet to Another
REM;

&Table1_rs.CopyTo(&Table1_cpy_rs);

REM
REM USE ROWSET TO READ RESULTS FROM A JOIN WITH BIND VARIABLE
REM;

&nbr = 10001;
&Table1_vw_rs = CreateRowset(Record.PTP_TABLE1_VW);
&Table1_vw_rs.Fill("WHERE PTP_SEQ_NBR >= :1", &nbr);

REM
REM  END OF EXERCISE CODE FOR PERFORMANCE COLLECTOR
REM;
&Rs = GetRowset(Scroll.PTP_TABLE1);

&Rs.Flush();
&Rs.Select(Record.PTP_TABLE1, "WHERE PTP_SEQ_NBR <= 10005");
&timeTaken = %PerfTime - &startTime;

Related Topics