execution time

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Dec 14 17:23:55 CET 2008


David Hláčik a écrit :
> Hi guys,
> 
> #! /usr/bin/python
> 
> import random
> import bucket2
> 
> data = [ random.randint(1,25) for i in range(5)]
> print "random data : %s" % data
> print "result: %s" %bucket2.sort(data)
> 
> How to write a test script which will outputs execution time for
> bucket2.sort(data) ?

http://docs.python.org/library/timeit.html

HTH



More information about the Python-list mailing list