MCPcopy Index your code
hub / github.com/clips/pattern / duration

Function duration

pattern/metrics.py:66–71  ·  view source on GitHub ↗

Returns the running time of the given function, in seconds.

(function, *args, **kwargs)

Source from the content-addressed store, hash-verified

64#### PROFILER ######################################################################################
65
66def duration(function, *args, **kwargs):
67 """ Returns the running time of the given function, in seconds.
68 """
69 t = time()
70 function(*args, **kwargs)
71 return time() - t
72
73def profile(function, *args, **kwargs):
74 """ Returns the performance statistics (as a string) of the given Python function.

Callers

nothing calls this directly

Calls 1

timeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…