Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

speed.py fixes #184

Merged
merged 2 commits into from Apr 10, 2012
Jump to file or symbol
Failed to load files and symbols.
+12 −8
Split
View
@@ -3,6 +3,10 @@
oneMillion = 1000000
+if sys.version_info >= (3,):
+ def xrange(v):
+ return range(int(v))
+
class Tester:
def foo(self):
return 1
@@ -12,7 +16,7 @@ def beginTimer(self):
def endTimer(self, s):
mps = 1/(time.time() - self.t1)
- print "Python %s := %0.2f" % (s, mps)
+ print("Python %s := %0.2f" % (s, mps))
def testSlot(self):
self.beginTimer()
@@ -61,21 +65,21 @@ def testSetLocals(self):
self.endTimer("localSets ")
def test(self):
- print ""
+ print("")
self.testLocals()
self.testSetLocals()
- print ""
+ print("")
self.testSlot()
self.testSetSlot()
- print ""
+ print("")
self.testBlock()
self.testInstantiations()
import sys
- print "Python version := \"%i.%i.%i %s %i\"" % sys.version_info
- print ""
- print "// values in millions per second"
- print ""
+ print("Python version := \"%i.%i.%i %s %i\"" % tuple(sys.version_info))
+ print("")
+ print("// values in millions per second")
+ print("")
Tester().test()