This commit is contained in:
zhouchengrong
2024-03-20 11:44:15 +08:00
commit 69132570aa
29 changed files with 815 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import time
import logging
def RunTime(func):
def wrapper(*args, **kwargs):
t1 = time.time()
res = func(*args, **kwargs)
t2 = time.time()
if t2 - t1 > 0.05:
logging.info(f"function{func.__name__}】,runtime{str(t2 - t1)}】s")
return res
return wrapper

View File

@@ -0,0 +1,10 @@
import threading
import uuid
id_lock = threading.Lock()
def generate_uuid():
with id_lock:
unique_id = str(uuid.uuid1())
return unique_id