timeit module for comparing the performance of two scripts

John Machin sjmachin at lexicon.net
Tue Jul 11 18:23:16 EDT 2006


On 12/07/2006 6:35 AM, 3c273 wrote:
> "Fredrik Lundh" <fredrik at pythonware.com> wrote in message
> news:mailman.8031.1152632499.27775.python-list at python.org...
> 
>> $ python -m timeit -s "import pyConfig" "pyConfig.pyConfig()"
>> $ python -m timeit -s "import pyConparse" "pyConparse.pyConParse()"
>>
>> note that timeit runs the benchmarked function multiple times, so you may
> want
>> to remove the print statements.
> 
> Hello,
> Could you tell me what the "-m" switch does or even better, where to find
> information on all switches in the documentation? Thanks.
> Louis

You appear to know what a switch is. I'm therefore surprised that you 
appear not to
know that the convention is that any program that uses
command-line switches should do something informative when run with a -h
switch.

HTH [NPI],
John



More information about the Python-list mailing list