Index: leahi_dialin/td/modules/buttons.py =================================================================== diff -u -r1f2bf6d939eb4033dbedb7d7005494cc12fccbc6 -r8ad61b1fa2e79b11b1c3db53a3242662e8eb9adf --- leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision 1f2bf6d939eb4033dbedb7d7005494cc12fccbc6) +++ leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision 8ad61b1fa2e79b11b1c3db53a3242662e8eb9adf) @@ -17,6 +17,7 @@ # Module imports from logging import Logger import struct +import time # Project imports from leahi_dialin.common.constants import NO_RESET @@ -51,6 +52,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): @@ -70,6 +72,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 @@ -80,6 +83,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: