fork download
  1. from timeit import Timer
  2. t1=Timer("random.shuffle(l)", "import random; l = list(range(100000))")
  3. t2=Timer("random.shuffle(l, random = random.random)", "import random; l = list(range(100000))")
  4. print("With default rand: %s" % t1.repeat(10,1))
  5. print("With custom rand: %s" % t2.repeat(10,1))
Success #stdin #stdout 3.42s 12480KB
stdin
Standard input is empty
stdout
With default rand: [0.20934200286865234, 0.21673798561096191, 0.21694588661193848, 0.20173192024230957, 0.20203495025634766, 0.21703600883483887, 0.21225810050964355, 0.20308804512023926, 0.20235681533813477, 0.20282506942749023]
With custom rand: [0.11149406433105469, 0.10450410842895508, 0.10693907737731934, 0.1060020923614502, 0.10250186920166016, 0.10420703887939453, 0.10447382926940918, 0.10320591926574707, 0.11251211166381836, 0.10591888427734375]