2010-10-15 22:36:25 +08:00
|
|
|
|
2010-11-18 22:19:20 +08:00
|
|
|
if __name__ == '__main__':
|
|
|
|
import cProfile
|
|
|
|
import py
|
|
|
|
import pstats
|
|
|
|
stats = cProfile.run('py.test.cmdline.main(["empty.py", ])', 'prof')
|
|
|
|
p = pstats.Stats("prof")
|
|
|
|
p.strip_dirs()
|
|
|
|
p.sort_stats('cumulative')
|
2013-10-03 19:53:22 +08:00
|
|
|
print(p.print_stats(50))
|