timeit function

Mag Gam magawake at gmail.com
Mon Aug 2 02:59:24 CEST 2010


Currently, I have a bash shell script which does timing for me. For
example, if I have a Unix Command I typically run time against it for
10 times and then get an average. It works fine but I have to write a
post processing script to get the time and then do a graph on
matplotlib.


I was wondering if the timeit function would be helpful in my case. I
was thinking to open a subprocess to run the Unix command 10 times
(instead of 1 million times) and then do the average and then do the
graph. Any thoughts about this?

Is timeit the right tool for what I am trying to do?

TIA...



More information about the Python-list mailing list