summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-26 20:56:10 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-26 20:56:10 (GMT)
commit8ca842066c947179892d50bf17b57943e7e5cd6b (patch)
tree36f095712bb110abdb9d129e8a59a09e4ce8d087 /Lib/profile.py
parentfa6e254b34b7a0f85cb34a9fd99b5a6400714940 (diff)
downloadcpython-8ca842066c947179892d50bf17b57943e7e5cd6b.zip
cpython-8ca842066c947179892d50bf17b57943e7e5cd6b.tar.gz
cpython-8ca842066c947179892d50bf17b57943e7e5cd6b.tar.bz2
A few lines were indented using spaces instead of tabs -- fix them.
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index f7de6a4..df36c17 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -438,7 +438,7 @@ class Profile:
sys.setprofile(None)
- #******************************************************************
+ #******************************************************************
# The following calculates the overhead for using a profiler. The
# problem is that it takes a fair amount of time for the profiler
# to stop the stopwatch (from the time it recieves an event).
@@ -481,35 +481,36 @@ class Profile:
# profiler very much, and the accuracy goes way up.
#**************************************************************
- def calibrate(self, m):
+ def calibrate(self, m):
+ # Modified by Tim Peters
n = m
- s = self.timer()
+ s = self.get_time()
while n:
self.simple()
n = n - 1
- f = self.timer()
- my_simple = f[0]+f[1]-s[0]-s[1]
+ f = self.get_time()
+ my_simple = f - s
#print "Simple =", my_simple,
n = m
- s = self.timer()
+ s = self.get_time()
while n:
self.instrumented()
n = n - 1
- f = self.timer()
- my_inst = f[0]+f[1]-s[0]-s[1]
+ f = self.get_time()
+ my_inst = f - s
# print "Instrumented =", my_inst
avg_cost = (my_inst - my_simple)/m
#print "Delta/call =", avg_cost, "(profiler fixup constant)"
return avg_cost
# simulate a program with no profiler activity
- def simple(self):
+ def simple(self):
a = 1
pass
# simulate a program with call/return event processing
- def instrumented(self):
+ def instrumented(self):
a = 1
self.profiler_simulation(a, a, a)