[RFC] a time interval class?

Robert Collins robertc at robertcollins.net
Tue Aug 14 21:56:32 BST 2007


We're doing interval calculations quite a bit now - with the smart
server logging, benchmark tests. Looks to me like we can save some code
by making a class to measure duration and report nicely formatted
strings.

something like
>>> duration = bzrlib.osutils (or wheverever) .Duration()
>>> duration.start()
>>> time.sleep(0.01)
>>> duration.stop()
>>> print duration
0.01 seconds
>>> duration.resume()
>>> time.sleep(0.01)
>>> duration.stop()
>>> print duration
0.02 seconds

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070815/d37c0fac/attachment.pgp 


More information about the bazaar mailing list