Lines Matching defs:ts
14 * ts - timespec at which the timer should fire.
19 struct timespec ts;
32 /* Adds ms milliseconds to ts. */
33 static inline void add_ms_ts(struct timespec *ts, unsigned int ms)
36 ts->tv_sec += ms / 1000;
39 ts->tv_nsec += ms * 1000000L;
40 if (ts->tv_nsec >= 1000000000L) {
41 ts->tv_sec += ts->tv_nsec / 1000000000L;
42 ts->tv_nsec %= 1000000000L;
71 clock_gettime(CLOCK_MONOTONIC_RAW, &t->ts);
72 add_ms_ts(&t->ts, ms);
101 int cras_tm_get_next_timeout(const struct cras_tm *tm, struct timespec *ts)
110 min = &tm->timers->ts;
112 if (timespec_sooner(&t->ts, min))
113 min = &t->ts;
119 ts->tv_sec = ts->tv_nsec = 0;
123 subtract_timespecs(min, &now, ts);
141 if (timespec_sooner(&t->ts, &now)) {