MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / Timer

Function Timer

rft/trainer/utils/__init__.py:29–34  ·  view source on GitHub ↗
(name: str)

Source from the content-addressed store, hash-verified

27
28@contextmanager
29def Timer(name: str):
30 start = time.perf_counter()
31 yield
32 end = time.perf_counter()
33 # torch.cuda.synchronize()
34 logger.info(f"[TIMER] {name}: {(end - start)*1000:.2f} ms")
35
36logger = logging.getLogger("ARL")
37logger.setLevel(logging.INFO)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected