delay(D3)delay(D3)NAMEdelay - delay process execution for a specified number of clock ticks
SYNOPSIS
void delay(long ticks);
Arguments
ticks The number of clock ticks to delay.
DESCRIPTIONdelay causes the caller to sleep for the amount of time specified by
ticks, which is in units of clock ticks. The exact length of the delay
is not guaranteed but it will not be less than ticks -1 clock ticks.
Return Values
None
USAGE
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. The drv_usectohz(D3) and drv_hztousec(D3) functions
can be used, as necessary, to convert between clock ticks and
microseconds (implementation independent units).
The delay function calls itimeout(D3) to schedule a wakeup after the
specified amount of time has elapsed. delay then goes to sleep until
itimeout wakes up the sleeping process.
Level
Base only.
Synchronization Constraints
Can sleep.
Driver-defined basic locks and read/write locks may not be held across
calls to this function.
Driver-defined sleep locks may be held across calls to this function, but
this is discouraged because it can adversely affect performance by
forcing any other processes contending for the lock to sleep for the
duration of the delay.
REFERENCESdrv_hztousec(D3), drv_usectohz(D3), drv_usecwait(D3), itimeout(D3),
sleep(D3), untimeout(D3), wakeup(D3)
Page 1