[Tutor] Timing a python program

Alan Gauld alan.gauld at btinternet.com
Fri Jan 16 09:52:42 CET 2015


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
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list