Skip to content

Instantly share code, notes, and snippets.

@tora16e
Created June 4, 2014 12:54
Show Gist options
  • Select an option

  • Save tora16e/a83485d6d1a7d069ddf3 to your computer and use it in GitHub Desktop.

Select an option

Save tora16e/a83485d6d1a7d069ddf3 to your computer and use it in GitHub Desktop.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment