drv_usectohz(D3DK) —
NAME
.IX \f4drv_usectohz\fP(D3DK)
drv_usectohz − convert microseconds to clock ticks
SYNOPSIS
#include <sys/types.h>
#include <sys/ddi.h>
clock_t drv_usectohz(clock_t microsecs);
ARGUMENTS
microsecsThe number of microseconds to convert to equivalent clock ticks.
DESCRIPTION
drv_usectohz converts the length of time expressed by microsecs, which is in units of microseconds, into units of clock ticks.
Several functions either take time values expressed in clock ticks as arguments [itimeout(D3DK), delay(D3DK)] or return time values expressed in clock ticks [drv_getparm(D3DK)]. The length of a clock tick can vary across different implementations, and therefore drivers should not include any hard-coded assumptions about the length of a tick. drv_usectohz and the complementary function drv_hztousec(D3DK) can be used, as necessary, to convert between microseconds and clock ticks.
RETURN VALUE
The value returned is the smallest number of clock ticks that represent a time interval equal to or greater than the microsecs argument. No error value is returned. If the number of ticks equivalent to the microsecs argument is too large to be represented as a clock_t, then the maximum clock_t value will be returned.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
SEE ALSO
delay(D3DK), drv_getparm(D3DK), drv_hztousec(D3DK), dtimeout(D3DK), itimeout(D3DK)
DDI/DKI