clocking subprocesses

barnburnr at gmail.com barnburnr at gmail.com
Mon Mar 3 21:14:29 CET 2008


On Mar 3, 12:41 pm, Preston  Landers <pland... at gmail.com> wrote:
>
> Run your command through the "time" program.  You can parse the output
> format of "time", or set a custom output format.  This mostly applies
> to Unix-like systems but there is probably an equivalent somewhere on
> Windows.
>
> Preston

Thanks for the quick answer.  That seems to work, though, I'll write a
timesubprocess() function which runs the program through time and
spits the formatted out to a file, then parses that file, then returns
the execution time.  There doesn't appear to be a more elegant way to
do this.

Kevin



More information about the Python-list mailing list