Ansicht
Dokumentation

ABAPGET_RUN_TIME - GET RUN TIME

ABAPGET_RUN_TIME - GET RUN TIME

rdisp/max_wprun_time - Maximum work process run time   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

GET RUN TIME

Short Reference



GET RUN TIME FIELD rtime.

Effect

When GET RUN TIME is executed for the first time after an internal session is created, the value 0 is passed to the variable rtime. After each further execution in the same internal session, the program runtime that has elapsed since the first execution is passed in microseconds to the variable rtime. The return value of the statement is of the data type i. The following can be specified for rtime:

  • An existing variable of the data type i or a variable to which the type i can be converted.

Notes

  • To measure the runtime of program sections, a GET RUN TIME statement can be executed before and after the required section and then the difference of the results can be calculated. The restricted sequence of statements is referred to as the measuring section, and the duration calculated for it is called the measuring interval.
  • The statement GET RUN TIME does not accumulate the duration of execution for individual ABAP statements. Instead it determines actual points in time with respect to the processor time. In particular, when for differences between these points in time, the statement also takes into account the duration for which for an internal session is rolled out of the memory. In a conceptual sense, a time defined using GET RUN TIME can be viewed as a time stamp. Unlike real POSIX time stamps, a time defined using GET RUN TIME is always precise to the microsecond, regardless of the platform. But on the other hand, it is restricted to the value range of the data type i.
  • The maximum resolution of the statement GET RUN TIME is a microsecond. Shorter measuring intervals cannot be determined reliably.
  • The value range of the return value of the statement must be respected. Measuring sections that are too large, that is, greater than 1000 s, should not be created, and also no measuring sections using accesses to external data or using dynpro calls and so on.
  • The statement SET RUN TIME CLOCK RESOLUTION can be used to defined the measuring precision before the first execution of GET RUN TIME, which is used to determine the runtime.
  • The runtime of program sections can also be determined using the tool runtime analysis.

Example

Determination of the calculation time for calculating the tangent of 1. Since the runtime of the statement is less than one microsecond, the runtime of multiple executions in an inner loop is measured. The execution time for the loop itself is also measured to deduct it as an offset. These measurements are executed multiple times in an outer loop and the mean value is calculated using division by n0. Division by ni determines the runtime of an individual statement.






CL_GUI_FRONTEND_SERVICES - Frontend Services   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 4881 Date: 20240426 Time: 211749     sap01-206 ( 97 ms )