time_code

(function from pyomo.contrib.pyros.util)

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

Starts timer at entry, stores elapsed time at exit.

Parameters:
  • timing_data_obj (TimingData) – Timing data object.

  • code_block_name (str) – Name of code block being timed.

  • is_main_timer (bool) – 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).