<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 8, 2022 at 11:06 AM Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ if (!(set_tm->tm_sec == read_tm->tm_sec)<br>
+ || !(set_tm->tm_min == read_tm->tm_min)<br>
+ || !(set_tm->tm_hour == read_tm->tm_hour)) {<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">nit: I should use 'A != B' directly but not '!(A==B)' in the expression.</div><div class="gmail_default" style="font-size:small">That looks strange anyway.</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+ seconds1 = (set_tm->tm_hour * 3600) + (set_tm->tm_min * 60) + set_tm->tm_sec;<br>
+ seconds2 = (read_tm->tm_hour * 3600) + (read_tm->tm_min * 60) + read_tm->tm_sec;<br>
+<br>
+ delta = seconds2 - seconds1;<br>
+<br>
+ if (delta < 0 || delta > 3)<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Better to print seconds value if fails.</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>