1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
def run_time(func): def wrapper(*args, **kwargs): start = time.time() func_return = func(*args, **kwargs) end = time.time() log.info(f'函数名:{func.__name__}() 执行时间: {end - start}s') print(f'函数名:{func.__name__}() 执行时间: {end - start}s') return func_return return wrapper
|