Lines Matching refs:t1

129 static inline int tst_timespec_lt(struct timespec t1, struct timespec t2)  in tst_timespec_lt()  argument
131 if (t1.tv_sec == t2.tv_sec) in tst_timespec_lt()
132 return t1.tv_nsec < t2.tv_nsec; in tst_timespec_lt()
134 return t1.tv_sec < t2.tv_sec; in tst_timespec_lt()
157 static inline struct timespec tst_timespec_diff(struct timespec t1, in tst_timespec_diff() argument
162 res.tv_sec = t1.tv_sec - t2.tv_sec; in tst_timespec_diff()
164 if (t1.tv_nsec < t2.tv_nsec) { in tst_timespec_diff()
166 res.tv_nsec = 1000000000 - (t2.tv_nsec - t1.tv_nsec); in tst_timespec_diff()
168 res.tv_nsec = t1.tv_nsec - t2.tv_nsec; in tst_timespec_diff()
174 static inline long long tst_timespec_diff_ns(struct timespec t1, in tst_timespec_diff_ns() argument
177 return t1.tv_nsec - t2.tv_nsec + 1000000000LL * (t1.tv_sec - t2.tv_sec); in tst_timespec_diff_ns()
180 static inline long long tst_timespec_diff_us(struct timespec t1, in tst_timespec_diff_us() argument
183 return tst_timespec_to_us(tst_timespec_diff(t1, t2)); in tst_timespec_diff_us()
186 static inline long long tst_timespec_diff_ms(struct timespec t1, in tst_timespec_diff_ms() argument
189 return tst_timespec_to_ms(tst_timespec_diff(t1, t2)); in tst_timespec_diff_ms()
195 static inline struct timeval tst_timeval_diff(struct timeval t1, in tst_timeval_diff() argument
200 res.tv_sec = t1.tv_sec - t2.tv_sec; in tst_timeval_diff()
202 if (t1.tv_usec < t2.tv_usec) { in tst_timeval_diff()
204 res.tv_usec = 1000000 - (t2.tv_usec - t1.tv_usec); in tst_timeval_diff()
206 res.tv_usec = t1.tv_usec - t2.tv_usec; in tst_timeval_diff()
212 static inline long long tst_timeval_diff_us(struct timeval t1, in tst_timeval_diff_us() argument
215 return tst_timeval_to_us(tst_timeval_diff(t1, t2)); in tst_timeval_diff_us()
218 static inline long long tst_timeval_diff_ms(struct timeval t1, in tst_timeval_diff_ms() argument
221 return tst_timeval_to_ms(tst_timeval_diff(t1, t2)); in tst_timeval_diff_ms()
227 static inline struct timespec tst_timespec_abs_diff(struct timespec t1, in tst_timespec_abs_diff() argument
230 if (tst_timespec_lt(t1, t2)) in tst_timespec_abs_diff()
231 return tst_timespec_diff(t2, t1); in tst_timespec_abs_diff()
233 return tst_timespec_diff(t1, t2); in tst_timespec_abs_diff()
236 static inline long long tst_timespec_abs_diff_us(struct timespec t1, in tst_timespec_abs_diff_us() argument
239 return tst_timespec_to_us(tst_timespec_abs_diff(t1, t2)); in tst_timespec_abs_diff_us()
242 static inline long long tst_timespec_abs_diff_ms(struct timespec t1, in tst_timespec_abs_diff_ms() argument
245 return tst_timespec_to_ms(tst_timespec_abs_diff(t1, t2)); in tst_timespec_abs_diff_ms()