We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 420ef62 commit d943404Copy full SHA for d943404
1 file changed
adafruit_httpserver/server.py
@@ -443,11 +443,12 @@ def poll(self) -> str:
443
444
conn = None
445
try:
446
+ if self.debug:
447
+ _debug_start_time = monotonic()
448
+
449
conn, client_address = self._sock.accept()
450
conn.settimeout(self._timeout)
451
- _debug_start_time = monotonic()
-
452
# Receive the whole request
453
if (request := self._receive_request(conn, client_address)) is None:
454
conn.close()
@@ -468,9 +469,8 @@ def poll(self) -> str:
468
469
# Send the response
470
response._send() # pylint: disable=protected-access
471
- _debug_end_time = monotonic()
472
473
if self.debug:
+ _debug_end_time = monotonic()
474
_debug_response_sent(response, _debug_end_time - _debug_start_time)
475
476
return REQUEST_HANDLED_RESPONSE_SENT
0 commit comments