Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

doubt with GET RUN TIME FIELD

Former Member
0 Kudos

Hi,

Please solve the following query?

line 10: DATA: t1 TYPE f, t2 TYPE f.

line 20: GET RUN TIME FIELD t1.

line 30: GET RUN TIME FIELD t2.

line 31: t2 = t2 - t1.

I have put the breakpoints on the above mentioned lines and monitoring thje values of t1 and t2.

At line 10: t1 = 0, t2 = 0,

At line 20: t1 = 0.

At line 30: t1 = 0, t2 = 0.

At line 31: t1 = 0, t2 = some value(ex 1.890000...) and accordingly t2 - t1 also.

Problem i am facing is that according to the definition of GET RUN TIME FIELD t2 in the first run the value of t2 shld be zero, but when we excute line 30 for the first time the value of t2 is changing. can any one help plz.

Regards,

Dhiraj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

t2 will not be zero.. only the first call of GET RUN TIME sets the field value to zero.. so only t1 will be zero.. For each subsequent call, the field ( t1 or t2 or whatever) contains the runtime in microseconds since the first call.

Arya.

2 REPLIES 2

Former Member
0 Kudos

t2 will not be zero.. only the first call of GET RUN TIME sets the field value to zero.. so only t1 will be zero.. For each subsequent call, the field ( t1 or t2 or whatever) contains the runtime in microseconds since the first call.

Arya.

former_member203627
Participant
0 Kudos

Hi Dhiraj,

Check the following example, where T1 ia 0 but t2 is getting value. Always press F1 on your statement to check the help which has few helpfull example by SAP

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.

GET RUN TIME FIELD T2.

T2 = T2 - T1.

IF T2 < TMIN.

TMIN = T2.

ENDIF.

ENDDO.

WRITE: 'MOVE of 4000 byte:', TMIN, 'microseconds'.