summaryrefslogtreecommitdiffstats
path: root/Tools/pybench/systimes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/pybench/systimes.py')
-rw-r--r--Tools/pybench/systimes.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/Tools/pybench/systimes.py b/Tools/pybench/systimes.py
index 013add2..6bc7e80 100644
--- a/Tools/pybench/systimes.py
+++ b/Tools/pybench/systimes.py
@@ -31,6 +31,9 @@
the author. All Rights Reserved.
"""
+
+from __future__ import print_function
+
import time, sys
#
@@ -180,32 +183,32 @@ def processtime():
### Testing
def some_workload():
- x = 0L
- for i in xrange(10000000L):
- x = x + 1L
+ x = 0
+ for i in range(10000000):
+ x = x + 1
def test_workload():
- print 'Testing systimes() under load conditions'
+ print('Testing systimes() under load conditions')
t0 = systimes()
some_workload()
t1 = systimes()
- print 'before:', t0
- print 'after:', t1
- print 'differences:', (t1[0] - t0[0], t1[1] - t0[1])
- print
+ print('before:', t0)
+ print('after:', t1)
+ print('differences:', (t1[0] - t0[0], t1[1] - t0[1]))
+ print()
def test_idle():
- print 'Testing systimes() under idle conditions'
+ print('Testing systimes() under idle conditions')
t0 = systimes()
time.sleep(1)
t1 = systimes()
- print 'before:', t0
- print 'after:', t1
- print 'differences:', (t1[0] - t0[0], t1[1] - t0[1])
- print
+ print('before:', t0)
+ print('after:', t1)
+ print('differences:', (t1[0] - t0[0], t1[1] - t0[1]))
+ print()
if __name__ == '__main__':
- print 'Using %s as timer' % SYSTIMES_IMPLEMENTATION
- print
+ print('Using %s as timer' % SYSTIMES_IMPLEMENTATION)
+ print()
test_workload()
test_idle()