MCPcopy
hub / github.com/zai-org/CogView / elapsed

Method elapsed

utils.py:108–122  ·  view source on GitHub ↗

Calculate the elapsed time.

(self, reset=True)

Source from the content-addressed store, hash-verified

106 self.started_ = False
107
108 def elapsed(self, reset=True):
109 """Calculate the elapsed time."""
110 started_ = self.started_
111 # If the timing in progress, end it first.
112 if self.started_:
113 self.stop()
114 # Get the elapsed time.
115 elapsed_ = self.elapsed_
116 # Reset the elapsed time
117 if reset:
118 self.reset()
119 # If timing was in progress, set it back.
120 if started_:
121 self.start()
122 return elapsed_
123
124 def __init__(self):
125 self.timers = {}

Callers 2

logMethod · 0.80
trainFunction · 0.80

Calls 3

stopMethod · 0.95
resetMethod · 0.95
startMethod · 0.95

Tested by

no test coverage detected