TVTOHZ(9) | Kernel Developer's Manual | TVTOHZ(9) |
tvtohz
, tstohz
— translate time period to timeout delay
#include
<sys/types.h>
#include <sys/time.h>
#include <sys/systm.h>
int
tvtohz
(const
struct timeval *tv);
int
tstohz
(const
struct timespec *ts);
The
tvtohz
()
and
tstohz
()
functions return the number of ticks in the specified amount of time. If the
return value would exceed the maximum value representable by an
int, it is capped at INT_MAX
.
They are mainly used to translate a timeval or
timespec, respectively, into a suitable argument for
tsleep(9).
These functions are implemented in the file sys/kern/kern_clock.c.
January 18, 2019 | OpenBSD-current |