Skip to content

Instantly share code, notes, and snippets.

@tonybaloney
Last active August 2, 2016 12:17
Show Gist options
  • Save tonybaloney/58c475df5a17227b94003e490b2a8037 to your computer and use it in GitHub Desktop.
Save tonybaloney/58c475df5a17227b94003e490b2a8037 to your computer and use it in GitHub Desktop.
import timeit
setup = '''
import random
random.seed('slartibartfast')
s = [random.random() for i in range(1000)]
timsort = list.sort
'''
print sum(timeit.Timer('a=s[:]; timsort(a)', setup=setup).repeat(7, 1000))
@tonybaloney
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment