Index: leahi_dialin/td/modules/buttons.py =================================================================== diff -u -re45b20cdc5d4c5dcff8cef530b173ca94cb2e422 -r820c94585ab5d85c40395e828c4dfe2da164c105 --- leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision e45b20cdc5d4c5dcff8cef530b173ca94cb2e422) +++ leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision 820c94585ab5d85c40395e828c4dfe2da164c105) @@ -17,6 +17,7 @@ # Module imports from logging import Logger import struct +import time # Project imports from leahi_dialin.common.constants import NO_RESET @@ -52,6 +53,7 @@ self.td_power_off_timestamp = 0.0 #: The timestamp of the last message self.poweroff_timeout_expired = False #: The Power Off timeout value + self.handler_execution_times = [] def reset_poweroff_timeout_expired(self): @@ -71,6 +73,7 @@ @param message: The poweroff timeout occurred message string @return: None """ + start = time.perf_counter() if len(message["message"]) < 16: self.logger.debug("Poweroff message id detected, but was the wrong length.") return @@ -81,6 +84,7 @@ if len(mode) > 0: self.poweroff_timeout_expired = bool(mode[0]) self.td_power_off_timestamp = timestamp + self.handler_execution_times.append(time.perf_counter() - start) def cmd_off_button_override(self, state: int, reset: int = NO_RESET) -> int: