MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / MyTimerAspect

Class MyTimerAspect

python/tutorial/MyGAspect/MyTimerAspect.py:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11from pycgraph import GAspect, CStatus
12
13class MyTimerAspect(GAspect):
14 _start_time = None
15
16 def beginRun(self):
17 self._start_time = time.time()
18 return CStatus()
19
20 def finishRun(self, curStatus: CStatus):
21 span = time.time() - self._start_time
22 print('----> [MyTimerAspect] {0} time cost is : {1}s'.format(self.getName(), round(span, 2)))
23 return

Callers 1

tutorial_aspectFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected