Home | History | Annotate | Download | only in kern

Lines Matching refs:ts

68 	struct timespec now, ts;
70 ts = *tsp; /* Don't modify original tsp. */
72 timespecsub(&ts, &now, &ts);
73 return tstohz(&ts);
79 struct timespec now, ts;
81 ts = *tsp; /* Don't modify original tsp. */
83 timespecsub(&ts, &now, &ts);
84 return tstohz(&ts);
88 inittimeleft(struct timespec *ts, struct timespec *sleepts)
91 if (itimespecfix(ts)) {
94 KASSERT(ts->tv_sec >= 0);
100 gettimeleft(struct timespec *ts, struct timespec *sleepts)
104 KASSERT(ts->tv_sec >= 0);
107 * Reduce ts by elapsed time based on monotonic time scale.
114 if (timespeccmp(ts, &sleptts, <=)) { /* timed out */
115 timespecclear(ts);
118 timespecsub(ts, &sleptts, ts);
120 return tstohz(ts);
124 clock_timeleft(clockid_t clockid, struct timespec *ts, struct timespec *sleepts)
129 timespecadd(ts, sleepts, ts);
130 timespecsub(ts, &sleptts, ts);
135 clock_gettime1(clockid_t clock_id, struct timespec *ts)
164 TIMEVAL_TO_TIMESPEC(&cputime, ts);
181 bintime2timespec(&tm, ts);
187 nanotime(ts);
190 nanouptime(ts);
203 ts2timo(clockid_t clock_id, int flags, struct timespec *ts,
209 if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000L)
221 if (!timespecsubok(ts, &tsd))
223 timespecsub(ts, &tsd, &tsd);
224 ts = &tsd;
227 error = itimespecfix(ts);
231 if (ts->tv_sec == 0 && ts->tv_nsec == 0)
234 *timo = tstohz(ts);