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: 

System Variable for Response Time?

Former Member
0 Kudos
631

Hi Folks,

does anyone know if there exists a System Variable that shows me the response time of a Function?

I want to implement a performance Check of different functions and show a line Graph of the response Time. Any Hints would be highly appreciatet!

Dennis

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
281

Not a system variable, but you would need to do this measurement manually. You can use the following to measure any runtime.

DATA: lr_runtime TYPE REF TO if_abap_runtime,
      lv_start TYPE i,
      lv_end TYPE i,
      lv_runtime TYPE i.

lr_runtime = cl_abap_runtime=>create_hr_timer( ).

lv_start = lr_runtime->get_runtime( ).

* Do some processing
WAIT UP TO 5 SECONDS.

lv_end = lr_runtime->get_runtime( ).

lv_runtime = ( lv_end - lv_start ) / 1000.

WRITE: / ' time per call in microseconds: ', lv_runtime.

Regards,

Rich Heilman

13 REPLIES 13

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
282

Not a system variable, but you would need to do this measurement manually. You can use the following to measure any runtime.

DATA: lr_runtime TYPE REF TO if_abap_runtime,
      lv_start TYPE i,
      lv_end TYPE i,
      lv_runtime TYPE i.

lr_runtime = cl_abap_runtime=>create_hr_timer( ).

lv_start = lr_runtime->get_runtime( ).

* Do some processing
WAIT UP TO 5 SECONDS.

lv_end = lr_runtime->get_runtime( ).

lv_runtime = ( lv_end - lv_start ) / 1000.

WRITE: / ' time per call in microseconds: ', lv_runtime.

Regards,

Rich Heilman

0 Kudos
281

Yes i mean runtime, my fault. sorry for the confusion!

Anyway, thank ya all for responsing. Im using the interface abap_runtime right now, it does excactly what im looking for, thank you Rich!

matt
Active Contributor
0 Kudos
281

Hey guys - I did also say "Not useful for the original poster, I'll grant you" 😄

matt

0 Kudos
281

doesn't count, it was in parenthesis 😛

former_member194613
Active Contributor
0 Kudos
281

no there is no such a variable, because the measurement causes an overhead, i.e. time is only measured on demand, i.e. use command get runtime field start and ... stop, t = stop-start.

And don't forget to repeat measurements, otherwise your measurements will cause only confusion. Graphics ... waste of time, better implement the improvement.

Siegfried

Former Member
0 Kudos
281

Why not simply use SE30?

Rob

former_member194613
Active Contributor
0 Kudos
281

> I want to implement a performance Check of different functions

no so easy with SE30.

And runtime measurements can be done in a loop, gives better results.

Siegfried

0 Kudos
281

The SAPGui has a response time indicator for the last interation with the app server. I'm curious if there's a way of reading that, perhaps one of the gui/fe classes.

( Not useful for the original poster, I'll grant you ).

former_member787646
Contributor
0 Kudos
281

Hi

Try this....

Data: T type I.

Get Run Time Field T.

write:/ T.

Select * from VBAK INTO table ITAB.

Get Run Time Field T.

write:/ T.

Hope it helps.

Murthy

former_member194613
Active Contributor
0 Kudos
281

interesting so much confusion in such a simple question!

@Rich

lv_runtime = ( lv_end - lv_start ) / 1000.

What is the divide by 1000 good for? I am not aware that anything measure in nanoseconds.

The GUI shows response time, but response time is not runtime.

Last posting, why is the difference not calculated, if you repeat already given answers, then please improve them!

Siegfried

0 Kudos
281

>

> The GUI shows response time, but response time is not runtime.

> Siegfried

Obviously, but the op said "response time", not run time.

0 Kudos
281

Correct, but what he actually seems to mean is "run time", since he's talking about the time certain functions take to execute. I would put the term "response time" into the GUI/network domain.

I might be completely wrong, let me know if so. Only the OP can clarify, I think, we're all guessing.

Thomas

former_member194613
Active Contributor
0 Kudos
281

> Obviously, but the op said "response time", not run time.

yes that is true, but is also obvious that only runtime make sense in the original question

Siegfried