Lines Matching refs:us
56 static inline struct timeval tst_us_to_timeval(long long us)
60 ret.tv_sec = us / 1000000;
61 ret.tv_usec = us % 1000000;
688 tst_ts_from_us(enum tst_ts_type type, long long us)
692 tst_ts_set_sec(&ret, us / 1000000);
693 tst_ts_set_nsec(&ret, (us % 1000000) * 1000);
702 tst_timespec_from_us(long long us)
704 return tst_ts_to_timespec(tst_ts_from_us(TST_LIBC_TIMESPEC, us));
811 * Adds us microseconds to tst_ts.
814 tst_ts_add_us(struct tst_ts t, long long us)
818 tst_ts_set_sec(&res, tst_ts_get_sec(t) + us / 1000000);
819 tst_ts_set_nsec(&res, tst_ts_get_nsec(t) + (us % 1000000) * 1000);
825 * Adds us microseconds to struct timespec.
828 tst_timespec_add_us(struct timespec ts, long long us)
832 res = tst_ts_add_us(tst_ts_from_timespec(ts), us);
838 * Substracts us microseconds from tst_ts.
841 tst_ts_sub_us(struct tst_ts t, long long us)
845 tst_ts_set_sec(&res, tst_ts_get_sec(t) - us / 1000000);
846 tst_ts_set_nsec(&res, tst_ts_get_nsec(t) - (us % 1000000) * 1000);
852 * Substracts us microseconds from timespec.
855 tst_timespec_sub_us(struct timespec ts, long long us)
859 res = tst_ts_sub_us(tst_ts_from_timespec(ts), us);