计算函用运行用时

import cProfile
import random
def f2(lIn):
    print("count run time")
lIn = [random.random() for i in range(100000)]
cProfile.run('f2(lIn)')
posted @ 2018-03-19 23:01  随便了888  阅读(168)  评论(0编辑  收藏  举报