[RFC] a time interval class?
Marius Kruger
amanic at gmail.com
Wed Aug 15 07:01:23 BST 2007
On 8/15/07, Robert Collins <robertc at robertcollins.net> wrote:
> Adding a second timer might be useful, but I think an easier thing to do
> for the logging case is to just show the time since the last printout,
> which is perhaps what you mean your code does.
>
> As we have an object we can set state, so how about:
> if debugging:
> duration = Duration()
> duration.start()
> duration.show_since_last_print(True)
> ...
> if debugging:
> mutter("... %s", ..., duration)
> ...
> if debugging:
> mutter("... %s", ...., duration)
>
> where this would output strings like "4m2secs total, 25secs incremental"
>
yip, this is more or less what I was after (acturally just more :)
maybe
- duration = Duration()
- duration.start()
- duration.show_since_last_print(True)
+ duration = Duration(start=True, show_since_last_print=True)
regards
marius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20070815/abf9133c/attachment.htm
More information about the bazaar
mailing list