benchmarking question (from newbie)

Chris Liechti cliechti at gmx.net
Mon Apr 1 16:38:26 EST 2002


Jacq <jdake at worldonline.nl> wrote in news:3CA8BF7B.BE99768B at worldonline.nl:
> I am a student of "language and artificial intelligence".
> I would be very grateful if anyone could advise me on a
> benchmarking question I have:
> 
> What I have is a script that repeatedly calls a machine-learning
> program each time with different parameters/algorithms.
> What I need is to measure the time the machine-learning-programme
> takes running, *independent* of other processes running on the
> same machine.
> (I have no control over what processes are started up
> by other users, and I want to compare the speed of the different
> algorithms/parameter-combinations.)
> 
> I thought I could use something like this:
>     start = time.clock()
>     os.system("call to machine-learning program")
>     stop = time.clock()
>     cpuTime = stop - start
> But testing this on my own machine, I get different values for the same
> program-call depending on what other processes I have started on my
> machine.
> 
> I use Python 1.5 on linux (RedHat 6.1)

appart from time.clock beeing the right one, you could use the
'time' command on *nix/Linux as you anyway start an external app.

you can just add 'time' infront of an other command (shell):
$ time ls -l
and then it prints a statistics at the end.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list