[Tutor] Timing a python program

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jan 16 10:20:59 CET 2015


On 16/01/2015 08:52, Alan Gauld wrote:
> On 16/01/15 05:02, CL Talk wrote:
>
>> I am trying to see how I can time the whole program as well as various
>> functions that are part of the program.
>>
>
> That's called profiling and there is a Python profiler.
>
> Here's the official doc page
>
> https://docs.python.org/2/library/profile.html
>
> And here's the 'module of the week' description of using it:
>
> http://pymotw.com/2/profile/
>
>
> You might also find the timeit module handy.
>
> hth

For non Luddites https://docs.python.org/3/library/profile.html :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list