From be3942ea2fed39efbcd8ba04d85099696c068501 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Tue, 20 Jan 2026 17:41:34 +0800 Subject: [PATCH] =?UTF-8?q?optimize(MsgBase):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=98=9F=E5=88=97=E8=83=BD=E5=8A=9B=E5=9F=BA?= =?UTF-8?q?=E7=B1=BB=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B0=8F=E6=95=B0=E7=A7=92?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=E6=97=B6=E9=97=B4=E6=88=B3=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E6=96=B9=E6=B3=95=20'=5FinputMsg'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/MsgBase.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/base/MsgBase.py b/src/base/MsgBase.py index ad271ac..bd4f07b 100644 --- a/src/base/MsgBase.py +++ b/src/base/MsgBase.py @@ -7,8 +7,8 @@ This software is provided "as is", without any warranty of any kind. You may use, modify, and distribute this file under the terms of the MIT License. See the LICENSE file for details. """ -import time import queue +import datetime class MsgBase: @@ -53,7 +53,7 @@ class MsgBase: msg: str ): - timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] self._output_queue.put(f"{timestamp}-[{self._class_name:<15}] : {msg}") @@ -67,15 +67,3 @@ class MsgBase: return msg except queue.Empty: return None - - - def _inputMsg( - self, - timeout: float = 1.0 - ) -> bool: - - try: - self._input_queue.get(timeout=timeout) - return True - except queue.Empty: - return False