Index: leahi_dialin/td/modules/switches.py =================================================================== diff -u -r1f2bf6d939eb4033dbedb7d7005494cc12fccbc6 -r8ad61b1fa2e79b11b1c3db53a3242662e8eb9adf --- leahi_dialin/td/modules/switches.py (.../switches.py) (revision 1f2bf6d939eb4033dbedb7d7005494cc12fccbc6) +++ leahi_dialin/td/modules/switches.py (.../switches.py) (revision 8ad61b1fa2e79b11b1c3db53a3242662e8eb9adf) @@ -16,6 +16,7 @@ # Module imports from logging import Logger +import time # Project imports from leahi_dialin.common.constants import NO_RESET @@ -52,6 +53,7 @@ # The Switches data in dictionary format self.td_switches_status = { td_enum_repository.TDSwitchNames.H9_FRONT_DOOR.name: td_enum_repository.TDSwitchStatus.CLOSED.value } + self.handler_execution_times = [] @publish(["msg_id_td_switches_data", "td_switches_status", "td_switches_timestamp"]) @@ -62,13 +64,15 @@ @param message: published switches data message @return: none """ + start = time.perf_counter() sensor_list =[] sensor_list.append((td_enum_repository.TDSwitchNames.H9_FRONT_DOOR.name, DataTypes.U32)) self.process_into_dict(dict_to_update = self.td_switches_status, decoder_list = sensor_list, message = message) self.td_switches_timestamp = timestamp + self.handler_execution_times.append(time.perf_counter() - start) def cmd_switches_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: