REPORT ZCRON.
*--[ INI 20140523 Macros para medir tiempos de ejecución
DEFINE cron_data.
types: begin of ty_cron,
text(40),
t_ini type i,
t_fin type i,
t_dif type i,
end of ty_cron.
data: tb_cron_tab type standard table of ty_cron,
ls_cron_tab type ty_cron,
lv_cron_tmp type i.
END-OF-DEFINITION.
DEFINE cron_add.
get run time field lv_cron_tmp.
read table tb_cron_tab into ls_cron_tab with key text = &1.
if sy-subrc ne 0.
ls_cron_tab-text = &1.
ls_cron_tab-t_ini = lv_cron_tmp.
append ls_cron_tab to tb_cron_tab.
else.
ls_cron_tab-t_fin = lv_cron_tmp.
ls_cron_tab-t_dif = ls_cron_tab-t_fin - ls_cron_tab-t_ini.
modify tb_cron_tab from ls_cron_tab index sy-tabix.
endif.
END-OF-DEFINITION.
*--[ FIN 20140523 Macros para medir tiempos de ejecución
*--[ ONLY FOR EXAMPLE
TABLES: spfli.
cron_data. "<-- Create de DATA
cron_add 'ALL PROGRAM'. "<-- START #1 TIMER
cron_add 'SELECT SPFLI'. "<-- START #2 TIMER
SELECT * FROM spfli. ENDSELECT.
cron_add 'SELECT SPFLI'. "<-- STOP #2 TIMER
SELECT * FROM spfli. ENDSELECT.
cron_add 'ALL PROGRAM'. "<-- START #1 TIMER
*--[ View the internal table tb_cron_tab for timers