import cProfile import random def f2(lIn): print("count run time") lIn = [random.random() for i in range(100000)] cProfile.run('f2(lIn)')