added on air time measurement for easier time debugging

This commit is contained in:
dj2ls 2022-09-08 10:19:07 +02:00
parent 1924189bdc
commit c9bcfcbc04

View file

@ -432,6 +432,7 @@ class RF:
""" """
self.log.debug("[MDM] transmit", mode=mode) self.log.debug("[MDM] transmit", mode=mode)
static.TRANSMITTING = True static.TRANSMITTING = True
start_of_transmission = time.time()
# Toggle ptt early to save some time and send ptt state via socket # Toggle ptt early to save some time and send ptt state via socket
static.PTT_STATE = self.hamlib.set_ptt(True) static.PTT_STATE = self.hamlib.set_ptt(True)
jsondata = {"ptt": "True"} jsondata = {"ptt": "True"}
@ -573,6 +574,10 @@ class RF:
static.TRANSMITTING = False static.TRANSMITTING = False
threading.Event().set() threading.Event().set()
end_of_transmission = time.time()
transmission_time = end_of_transmission - start_of_transmission
self.log.debug("[MDM] ON AIR TIME", time=transmission_time)
def demodulate_audio( def demodulate_audio(
self, self,
audiobuffer: codec2.audio_buffer, audiobuffer: codec2.audio_buffer,