This should be enough >>>import time >>>tic = time.time() >>>function() >>>toc = time.time() >>>print toc - tic
On Thu, Jul 29, 2010 at 2:34 PM, Mahmood Naderan <nt_mahm...@yahoo.com> wrote: > Hi, > I want to measure a function run time. I read > http://docs.python.org/library/time.html but I am confused and don't know > which one is suitable. I don't know is daylight timing important or not.... > or is Y2K issue important for my case or not.... I also don't know how epoch > time is related to my work. > > I just want to do this (pseudocode): > start_time = get_current_time; > function(); > end_time = get_current_time; > print (end_time - start_time) > > the output should be 7600 (s) for example. What is the best and easiest way > to do that? > > Thanks, > > // Naderan *Mahmood; > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list