mirror of
https://github.com/karl0ss/bazarr-ai-sub-generator.git
synced 2025-04-26 14:59:21 +01:00
14 lines
438 B
Python
14 lines
438 B
Python
import time
|
|
from datetime import timedelta
|
|
|
|
def measure_time(func):
|
|
def wrapper(*args, **kwargs):
|
|
start_time = time.time()
|
|
result = func(*args, **kwargs)
|
|
end_time = time.time()
|
|
duration = end_time - start_time
|
|
human_readable_duration = str(timedelta(seconds=duration))
|
|
print(f"Function '{func.__name__}' executed in: {human_readable_duration}")
|
|
return result
|
|
return wrapper
|