Skip to content

Instantly share code, notes, and snippets.

View FlorenceMei's full-sized avatar

Florence Dandoy 梁玫玫 FlorenceMei

  • Brussels
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: