Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD profiling.
- DATA:
- lr_mel TYPE REF TO /movi/ms_st_mel_expression.
- APPEND INITIAL LINE TO ct_mel_expression REFERENCE INTO lr_mel.
- lr_mel->expression_type = /movi/dsd_if_const=>mel_type-on_sync.
- CONCATENATE zotcm_if_const=>melfunc_profile_init ' = function:profile_init()' _n
- '{' _n
- zotcm_if_array=>profilepoints ' = null;' _n
- '};' _n
- INTO lr_mel->expression RESPECTING BLANKS.
- APPEND INITIAL LINE TO ct_mel_expression REFERENCE INTO lr_mel.
- lr_mel->expression_type = /movi/dsd_if_const=>mel_type-on_sync.
- CONCATENATE zotcm_if_const=>melfunc_profile ' = function:profile(desc)' _n
- '{' _n
- zotcm_if_array=>profilepoints '[systemTime()] = desc;' _n
- '};' _n
- INTO lr_mel->expression RESPECTING BLANKS.
- APPEND INITIAL LINE TO ct_mel_expression REFERENCE INTO lr_mel.
- lr_mel->expression_type = /movi/dsd_if_const=>mel_type-on_sync.
- CONCATENATE zotcm_if_const=>melfunc_profile_dump ' = function:profile_dump()' _n
- '{' _n
- 'try' _n
- '{' _n
- 'conn = connect("file://%SDCARD%/Movilizer/profile.txt", "file");' _n
- 'if (isConnectionOpen(conn))' _n
- '{' _n
- 'prev = null;' _n
- 'forasc (timeStamp: ' zotcm_if_array=>profilepoints ')' _n
- '{' _n
- 'if (isDefined(prev))' _n
- '{' _n
- 'writeTextLine(conn, concat(" (", numberFormat("*0", timeStamp - prev), " ms)"));' _n
- '}' _n
- 'writeText(conn, concat("* ", ' zotcm_if_array=>profilepoints '[timeStamp]));' _n
- 'prev = timeStamp;' _n
- '}' _n
- 'close(conn);' _n
- '}' _n
- '}' _n
- 'catch(e) { }' _n
- 'finally { if (isConnectionOpen(conn)) { try { close(conn); } catch(e) { } } }' _n
- '};' _n
- INTO lr_mel->expression RESPECTING BLANKS.
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement