更新了下文档解释

This commit is contained in:
SnowindMe
2025-04-12 22:53:06 +08:00
parent 8ffe0fdf51
commit fc14b72e69

View File

@@ -3,6 +3,38 @@ from functools import wraps
from typing import Optional, Dict, Callable
import asyncio
"""
# 更好的计时器
感谢D指导
# 用法:
-
@Timer()
def func():
pass
-
time_dict = {}
@Timer("计数", time_dict)
def func():
pass
-
def func():
with Timer() as t:
pass
-
def func():
time_dict = {}
with Timer("计数", time_dict) as t:
pass
属性human_readable
自定义错误TimerTypeError
"""
class TimerTypeError(TypeError):
"""自定义类型错误"""