MCPcopy
hub / github.com/PromtEngineer/localGPT / timer

Function timer

rag_system/utils/batch_processor.py:12–19  ·  view source on GitHub ↗

Context manager to time operations

(operation_name: str)

Source from the content-addressed store, hash-verified

10
11@contextmanager
12def timer(operation_name: str):
13 """Context manager to time operations"""
14 start = time.time()
15 try:
16 yield
17 finally:
18 duration = time.time() - start
19 logger.info(f"{operation_name} completed in {duration:.2f}s")
20
21class ProgressTracker:
22 """Tracks progress and performance metrics for batch operations"""

Callers 4

runMethod · 0.90
process_in_batchesMethod · 0.85
process_streamingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected