]> granicus.if.org Git - python/commitdiff
Repair some longstanding comment errors:
authorTim Peters <tim.peters@gmail.com>
Sun, 7 Oct 2001 04:02:36 +0000 (04:02 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 7 Oct 2001 04:02:36 +0000 (04:02 +0000)
+ The last index in the timing tuple is 4, not 5 (noted by Guido).

+ The poorly named trace_dispatch_i works with float return values too.

Lib/profile.py

index eb3dba8f0f02d70b86764cc0a2a2d2a2c44a4c9b..93e665ff1208f7f79c1837a277cd4386b7842a8c 100755 (executable)
@@ -135,7 +135,7 @@ class Profile:
           non-recursive functions, this is the total execution time from start
           to finish of each invocation of a function, including time spent in
           all subfunctions.
-    [5] = A dictionary indicating for each function name, the number of times
+    [4] = A dictionary indicating for each function name, the number of times
           it was called by us.
     """
 
@@ -202,12 +202,12 @@ class Profile:
         return
 
 
-
-    # Dispatch routine for best timer program (return = scalar integer)
+    # Dispatch routine for best timer program (return = scalar, fastest if
+    # an integer but float works too -- and time.clock() relies on that).
 
     def trace_dispatch_i(self, frame, event, arg):
         timer = self.timer
-        t = timer() - self.t # - 1 # Integer calibration constant
+        t = timer() - self.t # - 1 # calibration constant
         if self.dispatch[event](self, frame,t):
             self.t = timer()
         else: