I felt that it was faster when I changed the Python installed in Windows 7 at work to 3.4.0, but that was the reason. I'm sorry if I couldn't test the execution time.
C:\pyworks>C:\Python34\python.exe -m runtime_test
1401870117.465672
1401870127.773703
Runtime is 10.308
C:\pyworks>C:\Python33\python.exe -m runtime_test
1401870129.476873
1401870139.385864
Runtime is 9.909
C:\pyworks>py -m runtime_test
1401870167.25
1401870175.41
Runtime is 8.167
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
import time
time1 = time.time()
print(time1)
process()
time2 = time.time()
print(time2)
time = float(time2 - time1)
print("Runtime is {0:.3f}".format(time))
def process():
for d in range(1000):
x = sum(i for i in range(100000))
if __name__ == '__main__':
main()
Recommended Posts