[LTP] [PATCH] Make getrusage04 be able to loop more times
Cyril Hrubis
chrubis@suse.cz
Mon Jun 12 17:04:23 CEST 2017
Hi!
> Do we have? I think we need something like below, not clear
> about if this can be done with function or macro ;).
>
> timval_minus(tv1, tv2)
> and
> timeval_gt
> timeval_lt
> timeval_e
We only need to add tst_timeval_diff_us() into tst_timer.h then we can
compare the resulting values in microsenconds. Which would mean adding
tst_timeval_to_us() and tst_timeval_diff(), then adding the
tst_timeval_diff_us() that combines these two.
It should be staturated difference though, i.e. the conversion from
timeval to microseconds should return LONG_LONG_MAX in a case that the
end result would overflow long long.
As I said I can add these into the tst_timer.h, and also fix the
timespec to us and ms conversions to be saturated.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list