GET RUN TIME

GET

Effect

Relative runtime in microseconds. The first call sets (initializes) the field f to zero. For each subsequent call, f contains the runtime in microseconds since the first call. The field f should be of type I.

Note

If the applications server is a multiple processor machine, switching the CPU to another processor may cause fluctuations in the returned runtime. When measuring the runtime of smaller program components, you can achieve the correct result by taking several measurements and using the minimum of these.

The following platforms support very accurate timing:
DEC-OSF/1 (not multi-processor modules)
HP-UX (not multi-processor modules)
IBM-AIX
SNI-SINIX
SUN-OS
WWINDOWS-NT
All other platforms calculate runtime to approximately the nearest 10000 microseconds.

Example

DATA: T1   TYPE I, 
	T2   TYPE I, 
	TMIN TYPE I. 
 
DATA: F1(4000), F2 LIKE F1. 
 
TMIN = 1000000. 
DO 10 TIMES. 
  GET RUN TIME FIELD T1. 
	MOVE F1 TO F2.		"Time measurement of the MOVE 
						"statement 
  GET RUN TIME FIELD T2. 
  T2 = T2 - T1. IF T2 < TMIN. TMIN = T2. ENDIF. 
ENDDO. 
WRITE: 'MOVE 4000 bytes takes', TMIN, 'microseconds'.

Related

To perform runtime measurements of complex processes, use Runtime analysis (Transaction SE30).