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

Function timeit

examples/runtime_comparison.py:21–36  ·  view source on GitHub ↗
(n_reps=10)

Source from the content-addressed store, hash-verified

19
20
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
38
39@timeit()

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…