Sunday, May 8, 2011

Help testing my new package-in-progress

Could some helpful Pythonista please try:

easy_install benchmarker.py

and let me know if it installs for you? If it installs, here's a simple script to use it and see if it works... this script is a pretty thin usage of the package but proves it works in a basic sense:


>>> import bench
>>> from bench.benchmarker import benchmark
>>> @benchmark()
... def time_me():
...    for _ in range(100):
...       pass
...
>>> time_me()
>>> bench.benchmarker.print_stats()
Sat May  7 22:06:06 2011    /tmp/tmp.pstats

         300 function calls in 0.002 CPU seconds

   Random listing order was used

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      100    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
      100    0.001    0.000    0.002    0.000 :1(foo)
      100    0.001    0.000    0.001    0.000 {range}



Thanks!
-Tennessee