<p>My opinion on this is that it might be a little too abstract. I'd go with what I essentially started which is to abstract just a monotonic clock with only what is needed. If the platform doesn't have a monitonic clock than it can be apprixmated.</p>

<p>This will also serve to explain the real intention of a monotonic clock and not just a plain timer.</p>
<p>My 2¢</p>
<p>Baruch</p>
<div class="gmail_quote">On Sep 27, 2012 1:19 PM,  <<a href="mailto:VaclavKrpec@eaton.com">VaclavKrpec@eaton.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everybody,<br>
<br>
I'm working on the "Use difftime for time comparison" bug (#313634).<br>
Charles directed me to the other one "Use monotonic clock for monitoring"<br>
attended to by Baruch; I believe that's very good idea, however I'd use a bit<br>
more encapsulated & general approach:<br>
<br>
1/ I'd create an opaque timer type and its get/set/cmp/inc/dec etc interface<br>
under common<br>
2/ implementation of the interface would use the monotonic clock if available<br>
(the clock_*time on Linux, potentially other monotonic clock impl. on other<br>
systems) and time_t as a fallback<br>
3/ when implemented, use of the timer shall be spread throughout the code,<br>
replacing direct use of time_t<br>
<br>
What do you think?<br>
I'm also a bit reluptant to do such a change in scope of the bugfix; I'd create<br>
a new feature req. for that, OK?<br>
<br>
Any comments/ suggestions welcome,<br>
<br>
Regards,<br>
<br>
Vaclav<br>
<br>
P.S: already managed to post this from another address by mistake, so please<br>
just discard the previous e-mail (or this one, depending on which you've read).<br>
<br>
--<br>
Václav Krpec<br>
Software Developer<br>
Network UPS Tools project<br>
Eaton Opensource Team<br>
Eaton European Innovation Center<br>
<br>
<br>
<br>
<br>
-----------------------------<br>
Eaton Elektrotechnika s.r.o. ~ S�dlo spolecnosti, jak je zaps�no v rejstr�ku: Kom�rovsk� 2406, Praha 9 - Horn� Pocernice, 193 00, Cesk� Republika ~ Jm�no, m�sto, kde byla spolecnost zaregistrov�na: Praha ~ Identifikacn� c�slo (ICO): 498 11 894<br>

-----------------------------<br>
<br>
<br>
_______________________________________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org">Nut-upsdev@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev</a></blockquote></div>