MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / total_timer

Function total_timer

tensorpack/utils/timer.py:52–57  ·  view source on GitHub ↗

A context which add the time spent inside to the global TotalTimer.

(msg)

Source from the content-addressed store, hash-verified

50
51@contextmanager
52def total_timer(msg):
53 """ A context which add the time spent inside to the global TotalTimer. """
54 start = timer()
55 yield
56 t = timer() - start
57 _TOTAL_TIMER_DATA[msg].feed(t)
58
59
60def print_total_timer():

Callers

nothing calls this directly

Calls 1

feedMethod · 0.45

Tested by

no test coverage detected