mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-09-05 07:36:45 +08:00
first commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import time
|
||||
import functools
|
||||
|
||||
def timeit(func):
|
||||
@functools.wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
start = time.perf_counter()
|
||||
result = func(*args, **kwargs)
|
||||
end = time.perf_counter()
|
||||
duration = end - start
|
||||
print(f"⏱️ {func.__name__} executed in {duration:.4f} seconds")
|
||||
return result
|
||||
return wrapper
|
||||
Reference in New Issue
Block a user