GET RUN TIME FIELD rtime.
At the first execution of GET RUN TIME after the creation of an
internal mode, the value 0 is placed
into the variable rtime. At each further execution in
the same internal mode, the program runtime that has elapsed since the first execution, in seconds,
is placed into the variable rtime. The return value of the statement is of the data type i.
Determining the calculation time for calculating the tangent of 1. Since the runtime of the statement is less than a microsecond, the runtime of several executions in an inner loop is measured. The exection time for the loop itself is also measured in order to deduct it as an offset. These measurements are executed several times in an outer loop and the mean value is created using division by n0. Through division by ni, the runtime of an individual statement is determined.
DATA: t0 TYPE i,
t1 TYPE i,
t2 TYPE i,
t3 TYPE i,
t4 TYPE i,
tm TYPE f,
no TYPE i VALUE 100,
ni TYPE i VALUE 1000,
res TYPE f.
DO no TIMES.
GET RUN TIME FIELD t1.
DO ni TIMES.
res = TAN( 1 ).
ENDDO.
GET RUN TIME FIELD t2.
GET RUN TIME FIELD t3.
DO ni TIMES.
ENDDO.
GET RUN TIME FIELD t4.
t0 = t0 + ( ( t2 - t1 ) - ( t4 - t3 ) ).
ENDDO.
tm = t0 / ni / no.