Skip to content

Instantly share code, notes, and snippets.

View sharath-mohan's full-sized avatar
😎
The sharath way of life

Sharath Mohan sharath-mohan

😎
The sharath way of life
View GitHub Profile
@sharath-mohan
sharath-mohan / utils.py
Created October 31, 2025 06:54
Time calculation decorator
from functools import wraps
import time
def measure_time(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time.perf_counter()
result = func(*args, **kwargs)
end = time.perf_counter()
print(f"{func.__name__} took {end - start:.6f} seconds")
return result