Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2017



drv_hztousec - convert clock ticks to microseconds


#include <sys/types.h>
#include <sys/ddi.h>

clock_t drv_hztousec(clock_t hertz);

Interface Level

Architecture independent level 1 (DDI/DKI).



The number of clock ticks to convert.


The drv_hztousec() function converts into microseconds the time expressed by hertz, which is in system clock ticks.

The length of time the system has been up since boot can be retrieved by calling ddi_get_lbolt(9F), which will return a value of type clock_t containing the number of clock ticks since boot. Drivers often use the value of lbolt before and after an I/O request to measure the amount of time it took the device to process the request. The drv_hztousec() function can be used by the driver to convert the reading from clock ticks to a known unit of time.

Return Values

The number of microseconds equivalent to the hertz parameter. No error value is returned. If the microsecond equivalent to hertz is too large to be represented as a clock_t, then the maximum clock_t value will be returned.


The drv_hztousec() function can be called from user, interrupt, or kernel context.

See Also

ddi_get_lbolt(9F), drv_usectohz(9F), drv_usecwait(9F)

Writing Device Drivers for Oracle Solaris 11.3