Skip to content

Instantly share code, notes, and snippets.

@funnydman
Created July 12, 2019 13:27
Show Gist options
  • Save funnydman/b52d8165ce739653869f99b7bc94790f to your computer and use it in GitHub Desktop.
Save funnydman/b52d8165ce739653869f99b7bc94790f to your computer and use it in GitHub Desktop.

Revisions

  1. FUNNYDMAN created this gist Jul 12, 2019.
    11 changes: 11 additions & 0 deletions timeit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import timeit

    setup = '''
    import random

    random.seed('slartibartfast')
    s = [random.random() for i in range(1000)]
    timsort = list.sort
    '''

    print(min(timeit.Timer('a=s[:]; timsort(a)', setup=setup).repeat(7, 1000)))