.TH drv_usectohz() "" "" "DDI/DKI Kernel Routine"
.PC "Convert microseconds to clock ticks"
.B "#include <sys/types.h>"
.B "#include <sys/ddi.h>"
\fBclock_t drv_usectohz(\fImicroseconds\^\fB)\fR
\fBclock_t \fImicroseconds\^\fB;\fR
.PP
.B drv_usectohz()
converts
.I microseconds
to clock ticks.
It returns the smallest number of clock ticks equal to or greater than
.IR microseconds ;
in other words, it rounds up, not down.
If the number of ticks is too large to fit into a
.BR clock_t ,
it returns the maximum value that will fit into a
.BR clock_t .
.SH "See Also"
DDI/DKI kernel routines,
delay(),
drv_getparm(),
drv_hztousec(),
dtimeout(),
itimeout()
.R
.SH Notes
.B drv_usectohz()
has base or interrupt level.
It does not sleep.
.PP
A driver can hold a
driver-defined basic lock, read/write lock, or sleep lock
across a call to this function.
.PP
Some functions take time values expressed in clock ticks;
others return time values expressed in clock ticks.
Each operating system has its own notion of what constitutes a clock tick;
therefore, a driver should not
hard-code any assumption about the length of a tick.
Rather, use
.B drv_usectohz()
and its complementary function
.B drv_hztousec()
to convert between microseconds and clock ticks.
