Skip to content

Commit

Permalink
Add @functools.wraps on timing decorator
Browse files Browse the repository at this point in the history
Without it, the name/docstring of the wrapped function is lost.
  • Loading branch information
naglis committed Dec 14, 2023
1 parent 1be8d73 commit 9920d53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cozy/architecture/profiler.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import time
import logging
import functools

log = logging.getLogger("timing")

def timing(f):
@functools.wraps(f)
def wrap(*args):
time1 = time.time()
ret = f(*args)
Expand Down

0 comments on commit 9920d53

Please sign in to comment.