MCPcopy Index your code
hub / github.com/deepspeedai/DeepSpeed / elapsed

Method elapsed

deepspeed/utils/timer.py:100–114  ·  view source on GitHub ↗

Calculate the elapsed time.

(self, reset=True)

Source from the content-addressed store, hash-verified

98 self.event_timers.clear()
99
100 def elapsed(self, reset=True):
101 """Calculate the elapsed time."""
102 started_ = self.started_
103 # If the timing in progress, end it first.
104 if self.started_:
105 self.stop()
106 # Get the elapsed time.
107 elapsed_ = self._get_elapsed_msec()
108 # Reset the elapsed time
109 if reset:
110 self.reset()
111 # If timing was in progress, set it back.
112 if started_:
113 self.start()
114 return elapsed_
115
116 def mean(self):
117 self.elapsed(reset=False)

Callers

nothing calls this directly

Calls 4

stopMethod · 0.95
_get_elapsed_msecMethod · 0.95
resetMethod · 0.95
startMethod · 0.95

Tested by

no test coverage detected