summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-07 04:02:36 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-07 04:02:36 (GMT)
commit6e22149cb694a1acd21d2d8ca7b614ba81cb2200 (patch)
tree383af65c55cf85f4551ba61990f913575bcca31e /Lib/profile.py
parentf2a67daca2206bab783abba99d428e5eaf36a8f7 (diff)
downloadcpython-6e22149cb694a1acd21d2d8ca7b614ba81cb2200.zip
cpython-6e22149cb694a1acd21d2d8ca7b614ba81cb2200.tar.gz
cpython-6e22149cb694a1acd21d2d8ca7b614ba81cb2200.tar.bz2
Repair some longstanding comment errors:
+ 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.
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index eb3dba8..93e665f 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -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: