On Fri, Sep 18, 2009 at 3:43 PM, steve <st...@lonetwin.net> wrote: > On 09/18/2009 03:33 PM, Vamsi wrote: > >> How to place the timer in python code. >> >> I want calculate the python script execution time. >> >> ex : Start Timer >> : End Timer >> >> Execution Time : End Timer - Start Timer. >> >> How can we write the python code for this. >> > http://docs.python.org/library/debug.html > > Specifically, the timeit module > http://docs.python.org/library/timeit.html > > btw, dunno if you've heard about this really neat web application. It is a > simple text box with a couple of buttons that answers questions such as > these. I forgot it's name. It's something like golgol or some such. > > cheers, > - steve > > -- > random non tech spiel: http://lonetwin.blogspot.com/ > tech randomness: http://lonehacks.blogspot.com/ > what i'm stumbling into: http://lonetwin.stumbleupon.com/ > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers >
Here's what I usually do on windows: from time import clock, strftime, gmtime start = clock() ... do you work here... end = clock() elapsed = end - start print "Time Taken to finish: %s" % (strftime("%Hhrs: %Mmins: %ssecs", gmtime(elapsed)) If you wish to record in miliseconds, you'll have to do some math on the 'elapsed' value. -- Thanks and best regards, Vishal Sapre --- "So say...Day by day, in every way, I am getting better, better and better !!!" "A Strong and Positive attitude creates more miracles than anything else. Because...Life is 10% how you make it, and 90% how you take it" "Diamond is another piece of coal that did well under pressureā "Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human, Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u Going.....Keep Going....."
_______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers