python source benchmark

Kragen Sitaker kragen at dnaco.net
Wed Oct 4 01:09:11 EDT 2000


In article <8rcdfv$2be$1 at ites.inria.fr>,
Cedric Adjih  <adjih at crepuscule.com> wrote:
>  I usually use the /bin/time command, time.time() (on a lightly
>loaded machine), or the profile module of Python for computing
>the time spent in a program (as another person indicated here).

The difference is that time.time() tells you how long it's been since
1969, and changes in it indicate how many wall-clock seconds have gone
by, while time.clock() tells you how much CPU time your process has
used.  So if your process spends most of its time waiting on external
events to happen, time.clock() will advance very slowly.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]





More information about the Python-list mailing list