I'd like some feedback on this li'l thing. If you want to have a look, the source is here, but I'm more interested in help on the API and naming stuff, so don't worry about that unless you want to!
I've written a wrapper for timeit.Timer
. It behaves a lot like the command line python -m timeit ...
interface, but makes comparison easier by providing a Python API for specifying functions to compare and arguments to use.
python -m timeit -s 'import my_function' 'my_function(10)'
You specify 10
as the arguments to the function and decorate my_function
with the provided decorator. When you run the comparisons, it prints a little table showing the results.