<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 2018/01/25 13:50, Li Wang wrote:
    <blockquote
cite="mid:CAEemH2fR0Q3as6YJBkQK3VZ0_sdc0Rubqk0of+n0NTf8PtocwA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:
          monospace,monospace;"><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Mon, Jan 22, 2018 at 10:19 PM,
            Cyril Hrubis <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin: 0px 0px 0px
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              <div style="font-family: monospace,monospace; display:
                inline;" class="gmail_default">​...<br>
              </div>
              <br>
              -       return tv.tv_sec * 1000 + tv.tv_usec / 1000;<br>
              +       return tst_timespec_to_ms(ts);<br>
            </blockquote>
            <div><br>
              <br>
              <div style="font-family: monospace,monospace; display:
                inline;" class="gmail_default">​Both patches(include the
                old-lib one) looks good.<br>
                <br>
              </div>
              <div style="font-family: monospace,monospace; display:
                inline;" class="gmail_default">I just have a small
                question about function tst_timespec_to_ms(), why the
                t.tv_nsec plus 500000 when convert to msec?<br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <pre>Hi Li,

It seems to round up/down the decimal produced by converting nesc to msec.
If the decimal is greater than 0.5,  round up it. If not, round down it.

Thanks,
Xiao Yang</pre>
    <blockquote
cite="mid:CAEemH2fR0Q3as6YJBkQK3VZ0_sdc0Rubqk0of+n0NTf8PtocwA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div style="font-family: monospace,monospace; display:
                inline;" class="gmail_default"><br>
                static inline long long tst_timespec_to_ms(struct
                timespec t)<br>
                {<br>
                    return t.tv_sec * 1000 + (t.tv_nsec + 500000) /
                1000000;<br>
                }<br>
                ​</div>
               <br>
            </div>
          </div>
          <br>
          -- <br>
          <div class="gmail_signature">Li Wang<br>
            <a moz-do-not-send="true" href="mailto:liwang@redhat.com"
              target="_blank">liwang@redhat.com</a></div>
        </div>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>

</pre>
    </blockquote>
    <br>
  </body>
</html>