[LTP] [RFC] [PATCH] lib/tst_test: Use CLOCK_MONOTONIC for -I option.

Li Wang liwang@redhat.com
Thu Jan 25 08:51:15 CET 2018


On Thu, Jan 25, 2018 at 2:59 PM, Xiao Yang <yangx.jy@cn.fujitsu.com> wrote:

> On 2018/01/25 13:50, Li Wang wrote:
>
>
>
> On Mon, Jan 22, 2018 at 10:19 PM, Cyril Hrubis <chrubis@suse.cz> wrote:
>
>> ​...
>>
>> -       return tv.tv_sec * 1000 + tv.tv_usec / 1000;
>> +       return tst_timespec_to_ms(ts);
>>
>
>
> ​Both patches(include the old-lib one) looks good.
>
> I just have a small question about function tst_timespec_to_ms(), why the
> t.tv_nsec plus 500000 when convert to msec?
>
> 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.
>
>
​Ah, yes. Thanks so much!​



-- 
Li Wang
liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180125/b399ad79/attachment.html>


More information about the ltp mailing list