How could i get execution times ?

Erno Kuusela erno-news at erno.iki.fi
Tue Jun 11 10:36:52 EDT 2002


In article <mailman.1023581654.26137.python-list at python.org>, Ken
Seehof <kseehof at neuralintegrator.com> writes:

| In other words, time.clock() is far more precise for elapsed
| time (the above example demonstrates precision on the order
| of microseconds -- more than adequate for profiling python
| code).  But time.time() apparently has a granularity on the
| order of a tenth of a second (on windows), which is fine for
| profiling slower applications like Microsoft Outlook :-)

the above is correct on windows. the situation is approximately the
reverse on unix. on unix, time.time() is very accurate in measuring
elapsed wall clock time, whereas time.clock() has poor resulution and
poor accuracy but tries to measure consumed cpu time instead of wall
clock time.

  -- erno




More information about the Python-list mailing list