[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

how can i profile every line of code

scsoce

2/21/2008 3:07:00 PM

I want to profile a function which has some lines of statement. It seem
that profile module only report function's stats instead of every line
of code, how can i profile every line of code?
thanks.
scsoce
2 Answers

Tim Lesher

2/21/2008 8:27:00 PM

0

On Feb 21, 10:06 am, scsoce <scs...@gmail.com> wrote:
> I want to profile a function which has some lines of statement. It seem
> that profile module only report function's stats instead of every line
> of code, how can i profile every line of code?
> thanks.

Use the hotshot profiler, and when creating the profiler instance,
specify linetimings=True:

http://docs.python.org/lib/module-ho...


Tim Lesher

2/21/2008 8:33:00 PM

0

On Feb 21, 3:27 pm, Tim Lesher <tles...@gmail.com> wrote:
> On Feb 21, 10:06 am, scsoce <scs...@gmail.com> wrote:
>
> > I want to profile a function which has some lines of statement. It seem
> > that profile module only report function's stats instead of every line
> > of code, how can i profile every line of code?
> > thanks.
>
> Use the hotshot profiler, and when creating the profiler instance,
> specify linetimings=True:
>
> http://docs.python.org/lib/module-ho...

Err, that should be "lineevents=True", not linetimings.