Friday, August 8, 2008

Announcing stopwatch 0.3.0 and the 7 Oars code repository

The 7 Oars code repository is a centralized location for small python programs and modules from 7 Oars, instead of having multiple wikis and source control systems for relatively small projects.

The first module as part of the code repository is stopwatch. stopwatch is a very simple python module for measuring time. I typically use it to measure the execution time of specifc parts of code or data processing threads. For example:

>>> import stopwatch
>>> t = stopwatch.Timer() # immediately starts the clock
>>> t.elapsed # elapsed time in seconds
>>> t.elapsed
>>> str(t) # pretty print
1.8 sec
>>> for i in xrange(0, 10000)
>>> pass
>>> t.elapsed # still going
>>> t.stop() # stop the timer
>>> t.elapsed
>>> t.elapsed # it will not go any more


via PyPi:
easy_install -U stopwatch

via subversion:
svn checkout stopwatch

No comments: