convert clock ticks to microseconds
clock_t drv_hztousec(clock_t ticks);
drv_hztousec converts the length of time expressed by
ticks, which is in units of clock ticks,
into units of microseconds.
The number of clock ticks to convert to equivalent microseconds.
drv_hztousec returns the number of microseconds
equivalent to the ticks argument.
No error value is returned.
If the microsecond equivalent to ticks
is too large to be represented as a clock_t,
then the maximum clock_t value is returned.
Several functions either take time values expressed in clock ticks as
or return time values expressed in clock ticks
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_hztousec and the complementary function
can be used, as necessary, to convert between clock
ticks and microseconds.
Note that the time value returned by drv_getparm
with an LBOLT argument
is often too large to represent in microseconds as a clock_t.
When using drv_getparm together with drv_hztousec to time
operations, drivers can help avoid overflow by converting the difference
between return values from successive calls to drv_getparm instead
of trying to convert the return values themselves.
Context and synchronization
1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
``Delays and busy-waits'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005