<br><br><div><span class="gmail_quote">On 8/15/07, <b class="gmail_sendername">Robert Collins</b> &lt;<a href="mailto:robertc@robertcollins.net">robertc@robertcollins.net</a>&gt; wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Adding a second timer might be useful, but I think an easier thing to do<br>for the logging case is to just show the time since the last printout,<br>which is perhaps what you mean your code does.<br><br>As we have an object we can set state, so how about:
<br>if debugging:<br>&nbsp;&nbsp;&nbsp;&nbsp;duration = Duration()<br>&nbsp;&nbsp;&nbsp;&nbsp;duration.start()<br>&nbsp;&nbsp;&nbsp;&nbsp;duration.show_since_last_print(True)<br>...<br>if debugging:<br>&nbsp;&nbsp;&nbsp;&nbsp;mutter(&quot;... %s&quot;, ..., duration)<br>...<br>if debugging:<br>&nbsp;&nbsp;&nbsp;&nbsp;mutter(&quot;... %s&quot;, ...., duration)
<br><br>where this would output strings like &quot;4m2secs total, 25secs incremental&quot;<br></blockquote></div><br>yip, this is more or less what I was after&nbsp; (acturally just more :)<br><br>maybe<br>-&nbsp;&nbsp;&nbsp; duration = Duration()
<br>-&nbsp;&nbsp;&nbsp; duration.start()<br>-&nbsp;&nbsp;&nbsp; duration.show_since_last_print(True)<br><br>+&nbsp;&nbsp; duration = Duration(start=True, show_since_last_print=True)<br><br>regards<br>marius<br>