From 4e6ef3dde340350de96f0435de22fb0582165af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 30 Dec 2018 12:43:13 +0100 Subject: [PATCH] Profiling decorators --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53b1e55..b8b1a84 100644 --- a/README.md +++ b/README.md @@ -1425,7 +1425,7 @@ with PyCallGraph(output=graph): from timeit import default_timer from datetime import timedelta -def stopwatch(func): +def time_me(func): def out(*args, **kwargs): start = default_timer() result = func(*args, **kwargs) @@ -1440,7 +1440,7 @@ def stopwatch(func): from cProfile import Profile from pstats import Stats -def profiler(func): +def profile_me(func): def out(*args, **kwargs): profile = Profile() result = profile.runcall(func, *args, **kwargs) @@ -1456,7 +1456,7 @@ def profiler(func): #### Prints arguments and output of a decorated function: ```python -def tracer(func): +def trace_me(func): def out(*args, **kwargs): result = func(*args, **kwargs) arg_list = [repr(x) for x in args]