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

Method thinking_timer

utils/logger.py:467–476  ·  view source on GitHub ↗

Context manager that times thinking stages.

(self, node_id: str, stage: str)

Source from the content-addressed store, hash-verified

465
466 @contextmanager
467 def thinking_timer(self, node_id: str, stage: str):
468 """Context manager that times thinking stages."""
469 self.__init_timers__()
470 start_time = time.time()
471 try:
472 yield
473 finally:
474 end_time = time.time()
475 duration = (end_time - start_time)
476 self._timers[f"thinking_{node_id}_{stage}"] = duration
477
478 @contextmanager
479 def memory_timer(self, node_id: str, operation_type: str, stage: str):

Calls 1

__init_timers__Method · 0.95

Tested by

no test coverage detected