Skip to content

Instantly share code, notes, and snippets.

View zakgrin's full-sized avatar
🎯
Focusing

Zakariya Abugrin zakgrin

🎯
Focusing
View GitHub Profile
@pavelpatrin
pavelpatrin / line_profiler_decorator.py
Last active September 6, 2023 14:49
Python line profiler decorator
def profile(func):
from functools import wraps
@wraps(func)
def wrapper(*args, **kwargs):
from line_profiler import LineProfiler
prof = LineProfiler()
try:
return prof(func)(*args, **kwargs)
finally: