2008 Aug 11 4:08 PM
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
2008 Aug 11 4:22 PM
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
2008 Aug 11 4:22 PM
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
2008 Aug 13 9:40 AM
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!
2008 Aug 13 11:52 AM
Hey guys - I did also say "Not useful for the original poster, I'll grant you" 😄
matt
2008 Aug 13 12:16 PM
2008 Aug 11 4:23 PM
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
2008 Aug 11 4:26 PM
2008 Aug 12 7:48 AM
> 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
2008 Aug 12 8:07 AM
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 ).
2008 Aug 12 8:21 AM
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
2008 Aug 12 8:59 AM
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
2008 Aug 12 11:02 AM
>
> The GUI shows response time, but response time is not runtime.
> Siegfried
Obviously, but the op said "response time", not run time.
2008 Aug 12 1:57 PM
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
2008 Aug 13 9:00 AM
> 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