comparison examples/basic/kidrun.py @ 82:5ca4be55ad0b trunk

Some minor cleanup.
author cmlenz
date Sat, 15 Jul 2006 11:59:13 +0000
parents 1da51d718391
children
comparison
equal deleted inserted replaced
81:d60486018004 82:5ca4be55ad0b
35 print ' --> render stage: %s ms (average)' % ( 35 print ' --> render stage: %s ms (average)' % (
36 (sum(times) / len(times) * 1000)) 36 (sum(times) / len(times) * 1000))
37 37
38 if __name__ == '__main__': 38 if __name__ == '__main__':
39 if '-p' in sys.argv: 39 if '-p' in sys.argv:
40 import profile, pstats 40 import hotshot, hotshot.stats
41 profile.run('test()', '.tmpl_prof') 41 prof = hotshot.Profile("template.prof")
42 stats = pstats.Stats('.tmpl_prof') 42 benchtime = prof.runcall(test)
43 stats.strip_dirs().sort_stats('time').print_stats(10) 43 stats = hotshot.stats.load("template.prof")
44 stats.strip_dirs()
45 stats.sort_stats('time', 'calls')
46 stats.print_stats()
44 else: 47 else:
45 test() 48 test()
Copyright (C) 2012-2017 Edgewall Software