MCPcopy Index your code
hub / github.com/python/cpython / trace_dispatch

Method trace_dispatch

Lib/profile.py:192–205  ·  view source on GitHub ↗
(self, frame, event, arg)

Source from the content-addressed store, hash-verified

190 # Heavily optimized dispatch routine for time.process_time() timer
191
192 def trace_dispatch(self, frame, event, arg):
193 timer = self.timer
194 t = timer()
195 t = t[0] + t[1] - self.t - self.bias
196
197 if event == "c_call":
198 self.c_func_name = arg.__name__
199
200 if self.dispatch[event](self, frame,t):
201 t = timer()
202 self.t = t[0] + t[1]
203 else:
204 r = timer()
205 self.t = r[0] + r[1] - t # put back unrecorded delta
206
207 # Dispatch routine for best timer program (return = scalar, fastest if
208 # an integer but float works too -- and time.process_time() relies on that).

Callers

nothing calls this directly

Calls 1

timerFunction · 0.85

Tested by

no test coverage detected