MCPcopy Create free account
hub / github.com/modelscope/modelscope / since_last_check

Method since_last_check

modelscope/preprocessors/cv/timer.py:74–84  ·  view source on GitHub ↗

Time since the last checking. Either :func:`since_start` or :func:`since_last_check` is a checking operation. Returns (float): Time in seconds.

(self)

Source from the content-addressed store, hash-verified

72 return self._t_last - self._t_start
73
74 def since_last_check(self):
75 """Time since the last checking.
76 Either :func:`since_start` or :func:`since_last_check` is a checking
77 operation.
78 Returns (float): Time in seconds.
79 """
80 if not self._is_running:
81 raise TimerError('timer is not running')
82 dur = time() - self._t_last
83 self._t_last = time()
84 return dur
85
86
87_g_timers = {} # global timers

Callers 2

__exit__Method · 0.95
check_timeFunction · 0.80

Calls 1

TimerErrorClass · 0.85

Tested by

no test coverage detected