update
This commit is contained in:
@@ -227,6 +227,13 @@ def read_complete_response(serial_connection, timeout=2, end_of_response_timeout
|
|||||||
# Final response and debug output
|
# Final response and debug output
|
||||||
total_elapsed_time = time.time() - start_time
|
total_elapsed_time = time.time() - start_time
|
||||||
print(f"[DEBUG] ⏱️ elapsed time: {total_elapsed_time:.2f}s. ⏱️")
|
print(f"[DEBUG] ⏱️ elapsed time: {total_elapsed_time:.2f}s. ⏱️")
|
||||||
|
# Check if the elapsed time exceeded 10 seconds
|
||||||
|
if total_elapsed_time > 10:
|
||||||
|
print(f"[ALERT] 🚨 The operation took too long: {total_elapsed_time:.2f}s. 🚨")
|
||||||
|
print('<span style="color: red;font-weight: bold;"></span>')
|
||||||
|
print(f"{total_elapsed_time:.2f}s")
|
||||||
|
print('</span>')
|
||||||
|
|
||||||
return response.decode('utf-8', errors='replace')
|
return response.decode('utf-8', errors='replace')
|
||||||
|
|
||||||
# Open and read the JSON file
|
# Open and read the JSON file
|
||||||
|
|||||||
Reference in New Issue
Block a user