'\"macro stdmacro
.if n .pH ddi_dki.drv_hztousec @(#)drv_hztousec	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} drv_hztousec D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} drv_hztousec D3DK "" "DDI/DKI"
.if \nX=2 .ds x} drv_hztousec D3DK "" "\&"
.if \nX=3 .ds x} drv_hztousec "" "" "\&"
.TH \*(x}
.IX "\f4drv_hztousec\fP(D3DK)"
.SH NAME
\f4drv_hztousec\f1 \- convert clock ticks to microseconds
.SH SYNOPSIS
.nf
.na
\f4#include <sys/types.h>
#include <sys/ddi.h>
.sp 0.5
clock_t drv_hztousec(clock_t \f2hz\f4);\f1
.ad
.fi
.SH ARGUMENT
.RS 0n 10
.IP "\f2hz\f1" 10n
The length of time (expressed in \f4HZ\f1 units) to convert to
its microsecond equivalent
.RE
.SH DESCRIPTION
\f4drv_hztousec\f1 converts into microseconds the length of time expressed by
\f2hz\f1, which is in units of time based on the value of \f4HZ\f1,
the kernel parameter whose value is defined in \f4sys/param.h\f1.
.P
The kernel variable \f4lbolt\f1, which is readable through
\f4drv_getparm\fP(D3DK), is the length of time the system has been
up since boot and is expressed in \f4HZ\f1 units.  Drivers often
use the value of \f4lbolt\f1 before and after an I/O request
to measure the amount of time it took the device to process
the request.  \f4drv_hztousec\f1 can be used by the driver to convert
the reading from \f4HZ\f1 units, which could potentially vary between
system implementations, to a known unit of time.
.SH RETURN VALUE
The number of microseconds equivalent to the \f2hz\f1 argument.
No error value is returned. If the microsecond equivalent
to \f2hz\f1 is too large to be represented as a \f4clock_t\f1, then the
maximum \f4clock_t\f1 value will be returned.
.SH LEVEL
Base or Interrupt
.SH SEE ALSO
.na
\f4drv_getparm\fP(D3DK),
\f4drv_usectohz\f1(D3DK)
.ad
