Profiler - counting individual lines' exec time

£ukasz Kowalczyk smithy at
Sat Aug 21 20:31:19 CEST 1999

Hi, everyone, it's my first posting on

I'm having hard time working with the Python profiler ( I have a
loop in my program which loops hundreds of thousands times and I want to know
which instructions in it take the most time to execute. Is that possible?

I imagine it could be done by tagging specific lines which execution time
I want measured but how do I do it? Using time.time() seems too messy and
not precise enough to me.

Moreover, documentation (html) provided seems to be incompatible with
reality :-) The Stats class does not provide any of the methods mentioned.

Łukasz Kowalczyk

More information about the Python-list mailing list