MCPcopy Create free account
hub / github.com/OpenBMB/ChatDev / agent_timer

Method agent_timer

utils/logger.py:431–440  ·  view source on GitHub ↗

Context manager that times agent invocations.

(self, node_id: str)

Source from the content-addressed store, hash-verified

429
430 @contextmanager
431 def agent_timer(self, node_id: str):
432 """Context manager that times agent invocations."""
433 self.__init_timers__()
434 start_time = time.time()
435 try:
436 yield
437 finally:
438 end_time = time.time()
439 duration = (end_time - start_time)
440 self._timers[f"agent_{node_id}"] = duration
441
442 @contextmanager
443 def human_timer(self, node_id: str):

Callers

nothing calls this directly

Calls 1

__init_timers__Method · 0.95

Tested by

no test coverage detected