1. import cProfile
    2. cProfile.run('main()')
    3. # cProfile 模块在您的系统中不可用的话, 用 Profile 代替.