Skip to content
Myr

Updated rwbench

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 02ea18a · Browse files · 1 file+13 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−0 removed

  • other:+13 added−0 removed

1 file+13 added−0 removed

modified:examples/rwbench/rwbench.py+13 added
10 unmodified lines
11 :license: BSD.12"""13import sys14from os.path import join, dirname, abspath15try:16 from cProfile import Profile17except ImportError:18 from profile import Profile19from pstats import Stats20ROOT = abspath(dirname(__file__))2122from random import choice, randrange23from datetime import datetime
77 unmodified lines
101 stmt='bench()')102 sys.stdout.write(' >> %-20s<running>' % test)103 sys.stdout.flush()104 sys.stdout.write('\r %-20s%.4f seconds\n' % (test, t.timeit(number=200) / 200))105106 if '-p' in sys.argv:107 print 'Jinja profile'108 p = Profile()109 p.runcall(test_jinja)110 stats = Stats(p)111 stats.sort_stats('time', 'calls')112 stats.print_stats()