Advertisement
pVinc

timing.py

May 1st, 2020
408
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. timearray = []
  2. for i in range(0,10):
  3.     print("*")
  4.     strt = time.time()
  5.     insertionsort([random.randint(0,1000) for iter in range(10000)])
  6.     endt = time.time()
  7.     timearray.append(endt-strt)
  8.  
  9. print("longest time: ", max(timearray))
  10. print("shortest time: ", min(timearray))
  11. print("avg. time: ", (max(timearray)+min(timearray))/2)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement