from timeit import Timer t1=Timer("random.shuffle(l)", "import random; l = list(range(100000))") t2=Timer("random.shuffle(l, random = random.random)", "import random; l = list(range(100000))") print "With default rand: %s" % t1.repeat(10,1) print "With custom rand: %s" % t2.repeat(10,1)
Standard input is empty
With default rand: [0.06446599960327148, 0.06304502487182617, 0.0665440559387207, 0.06493711471557617, 0.06709909439086914, 0.06563091278076172, 0.06643199920654297, 0.06531286239624023, 0.06582999229431152, 0.06594014167785645] With custom rand: [0.06772303581237793, 0.07025504112243652, 0.06624913215637207, 0.06295895576477051, 0.0655360221862793, 0.06254100799560547, 0.06248307228088379, 0.06627798080444336, 0.06652498245239258, 0.06913280487060547]