MCPcopy Index your code
hub / github.com/python/cpython / TimingWrapper

Class TimingWrapper

Lib/test/_test_multiprocessing.py:294–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292#
293
294class TimingWrapper(object):
295
296 def __init__(self, func):
297 self.func = func
298 self.elapsed = None
299
300 def __call__(self, *args, **kwds):
301 t = time.monotonic()
302 try:
303 return self.func(*args, **kwds)
304 finally:
305 self.elapsed = time.monotonic() - t
306
307#
308# Base class for test cases

Callers 9

_kill_processMethod · 0.85
test_putMethod · 0.85
test_getMethod · 0.85
test_timeoutMethod · 0.85
test_timeoutMethod · 0.85
test_eventMethod · 0.85
test_asyncMethod · 0.85
test_async_timeoutMethod · 0.85
test_connectionMethod · 0.85

Calls

no outgoing calls

Tested by 9

_kill_processMethod · 0.68
test_putMethod · 0.68
test_getMethod · 0.68
test_timeoutMethod · 0.68
test_timeoutMethod · 0.68
test_eventMethod · 0.68
test_asyncMethod · 0.68
test_async_timeoutMethod · 0.68
test_connectionMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…