Skip to content

Instantly share code, notes, and snippets.

@tistaharahap
Created August 28, 2016 11:52
Show Gist options
  • Save tistaharahap/168ac94857a4d9c93fc07c06cb555474 to your computer and use it in GitHub Desktop.
Save tistaharahap/168ac94857a4d9c93fc07c06cb555474 to your computer and use it in GitHub Desktop.
import time
def load(number, max):
for x in xrange(1, max):
number*number*x
if __name__ == '__main__':
max = 100000000
_start = time.time()
load(10, max)
_end = time.time()
elapsed_time = float(_end) - float(_start)
print 'Elapsed Time: %.2f second' % elapsed_time
print 'Ops/second: %.2f' % (float(max) / elapsed_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment