MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / Timings

Class Timings

benchmarks/src/utils/timing.py:45–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45class Timings:
46 def __init__(self):
47 self.timings = {}
48
49 def add(self, name, duration):
50 assert name not in self.timings
51 self.timings[name] = duration
52
53 def duration(self) -> float:
54 return self.timings["duration"]
55
56 def to_dict(self):
57 return dict(self.timings)
58
59 def __repr__(self):
60 return repr(self.timings)
61
62 @contextlib.contextmanager
63 def time(self, name="duration"):
64 start = time.time()
65 yield
66 duration = time.time() - start
67 self.add(name, duration)

Callers 2

measure_snake_tasksFunction · 0.85
measure_dask_tasksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected