[Tutor] Timing a python program

Albert-Jan Roskam fomcl at yahoo.com
Fri Jan 16 21:00:53 CET 2015


----------------------------
On Fri, Jan 16, 2015 7:34 PM CET Alan Gauld wrote:

>On 16/01/15 09:20, Mark Lawrence wrote:
>
>> https://docs.python.org/2/library/profile.html
>>
>> For non Luddites https://docs.python.org/3/library/profile.html :)
>
>
>Yeah, but the OP said it was for 2.7.6 on a Mac

python -m cProfile myscript.py
python -m timeit '<some python snippet here>'


More information about the Tutor mailing list