CL_ABAP_RUNTIME - Help Class for Runtime Measurement

Fill RESBD Structure from EBP Component Structure   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Functionality

Factory class for timer objects.

Using the two methods create_hr_timer()and create_lr_timer(), this class returns object instances that implement the interface IF_ABAP_RUNTIME. This interface specifies exactly one method,get_runtime(), which returns a result of type I, similar to the ABAP language command GET RUN TIME field.

An object created using create_hr_timer()(create high resolution timer) corresponds to the high accuracy of the ABAP command(SET RUN TIME CLOCK RESOLUTION HIGH), while an object created using create_lr_timer() corresponds to the lower accuracy.

Just as in the ABAP language, when the methodget_runtime() is called for the first time, it returns an object instance with the value 0.

The advantage of this class solution is that any number of these time objects of differing levels ofaccuracy can be used in the same roll area. When you use the ABAP language variant, you can set the accuracy only once, using the command SET RUN TIME CLOCK RESOLUTIONx . If you try to run this command more than once, the program terminates with a short dump.

The class wrapping has, however, a disadvantage: Implementing the kernel method is on principle 2 microsecondsslower as the variant integrated in ABAP. This may make it unsuitable for measuring very short code segments.

Die Klassenverschalung hat jeoch auch einen Nachteil: Die Implementation als Kernelmethode ist prinzipbedingtum etwa 2 Mikrosekunden langsamer als die im ABAP integrierte Variante. Dadurch eignet sie sich evtl. nicht um sehr kurze Codingstrecken zu vermessen.

Relationships

GET RUN TIME field.

SET RUN TIME CLOCK RESOLUTION x.

IF_ABAP_RUNTIME

Example

Notes

Further information



General Material Data   Vendor Master (General Section)  
This documentation is copyright by SAP AG.


Length: 1911 Date: 20120526 Time: 082607     triton ( 89 ms )