how to measure running time of algorithms in python
Question: > **Possible Duplicates:**  
>  [Accurate timing of functions in
> python](http://stackoverflow.com/questions/889900/accurate-timing-of-
> functions-in-python)  
>  [accurately measure time python function
> takes](http://stackoverflow.com/questions/1685221/accurately-measure-time-
> python-function-takes)

How can i mesure and compare the running times of my algorithms written in
python .Also point me to a nice algorithms site/forum like stackoverflow if
you can.


Answer: The module [`timeit`](http://docs.python.org/library/timeit.html) is useful
for this and is included in the standard Python distribution.

Example:

    
    
    import timeit
    timeit.Timer('for i in xrange(10): oct(i)').timeit()
    

