use monotonic clock for detector inference duration to prevent negative values from wall clock steps

This commit is contained in:
Josh Hawkins 2026-05-21 07:55:17 -05:00
parent 66a2417229
commit 1cad5a78df

View File

@ -167,8 +167,9 @@ class DetectorRunner(FrigateProcess):
# detect and send the output # detect and send the output
self.start_time.value = datetime.datetime.now().timestamp() self.start_time.value = datetime.datetime.now().timestamp()
mono_start = time.monotonic()
detections = object_detector.detect_raw(input_frame) detections = object_detector.detect_raw(input_frame)
duration = datetime.datetime.now().timestamp() - self.start_time.value duration = time.monotonic() - mono_start
frame_manager.close(connection_id) frame_manager.close(connection_id)
if connection_id not in self.outputs: if connection_id not in self.outputs: