NASD Programmer's Documentation
Delays

The NASD delay mechanism is provided to allow threads to block for specified amounts of time. Before using it, you must initialize the threads module. The delay mechanism provides a delay type nasd_delaycounter_t. To introduce a delay of a number of microseconds:


nasd_delaycounter_t delayer;

NASD_BEGIN_DELAYCNT(&delayer);
NASD_DELAY_FROM(&delayer, usec_delay);
It may seem odd to separate the functionality into two calls. However, this allows an arbitrary amount of computation to occur between the NASD_BEGIN_DELAYCNT() and the NASD_DELAY_FROM() calls. NASD_DELAY_FROM() will ensure that at least usec_delay microseconds have elapsed after NASD_BEGIN_DELAYCNT() and before NASD_DELAY_FROM() completes. One place where this is used is in the drive read-throttling code. The inner transmit loop ensures that each transfer consumes a minimum amount of time, thus bounding the resulting bandwidth.
<--- ---> ^<br>|<br>|
Timing Timeouts NASD Programmer's Documentation