time_code

(function from pyomo.contrib.gdpopt.util)

pyomo.contrib.gdpopt.util.time_code(timing_data_obj, code_block_name, is_main_timer=False)[source]

Starts timer at entry, stores elapsed time at exit

If is_main_timer=True, the start time is stored in the timing_data_obj, allowing calculation of total elapsed time ‘on the fly’ (e.g. to enforce a time limit) using get_main_elapsed_time(timing_data_obj).