Saturday, January 10, 2009

Announcing stopwatch 0.3.1

There is a new release of stopwatch, a simple utility for measuring time in Python. The release addes a simple decorator for functions to print the execution time of each call to that function.

>>> from stopwatch import clockit
>>> @clockit
def multiply(a, b):
return a * b
>>> r = multiple(4, 5)
multiple in 1.38282775879e-05 sec
>>> print r

You can obtain the new release with easy_install
easy_install -U stopwatch

or download the appropriate release.


Unknown said...

I've found your stopwatch to use in my python program, the only thing is, when trying to import it, it generates an error saying:
"SyntaxError: invalid syntax (, line 98). I've tried solving it myself, but my knowledge of python isn't very big.. could you tell me what's wrong please? Thanks you in advance, and thank you for programming such a handy little module like this =)

vosa said...

thank you for your program. Btw. maybe this method is good idea :)

def reset(self):self.__init__()

Unknown said...

Betting in your city - Sporting 100
Betting in 토토사이트 your 토토 city - Sporting 100