diff --git a/cozy/architecture/profiler.py b/cozy/architecture/profiler.py index d5a84e8b..10a7009b 100644 --- a/cozy/architecture/profiler.py +++ b/cozy/architecture/profiler.py @@ -1,13 +1,15 @@ import time import logging +import functools log = logging.getLogger("timing") def timing(f): + @functools.wraps(f) def wrap(*args): - time1 = time.time() + time1 = time.perf_counter() ret = f(*args) - time2 = time.time() + time2 = time.perf_counter() log.info('{:s} function took {:.3f} ms'.format(f.__name__, (time2-time1)*1000.0)) return ret