MCPcopy Create free account
hub / github.com/modAL-python/modAL / timer

Function timer

examples/runtime_comparison.py:23–34  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

21def timeit(n_reps=10):
22
23 def timer(func):
24
25 def timed_func(*args, **kwargs):
26 start = time()
27 for _ in range(n_reps):
28 result = func(*args, **kwargs)
29 end = time()
30 print("%s has been executed in %f s avg for %d reps" % (func.__name__, (end - start)/n_reps, n_reps))
31 runtime[func.__name__] = (end - start)/n_reps
32 return result
33
34 return timed_func
35
36 return timer
37

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…