|
// Simple busywait. |
|
// usleep() is not granular enough |
|
static void |
|
upause(int n) |
|
{ |
|
int i; |
|
volatile uint64_t j = sys_cpu_timestamp(); |
|
for (i = 0; i < n; ++i) { |
|
j += i; |
|
rte_pause(); |
|
} |
|
} |
Maybe simply asm("nop") is better:
for (i = 0; i < n; ++i) {
asm("nop");
rte_pause();
}
portable-lib/test/t_ringbuf.c
Lines 188 to 199 in 9b47975
Maybe simply
asm("nop")is better: