title: microsecond user-space busy-wait loop
body: <p>Any suggestions for a function like udelay in linux/delay.h that can be used in user-space? </p>
  
  <p>From userspace, I'd like to generate events every 10s of mircoseconds. Accuracy isn't super important, but I'd like to get it as close as possible. Things like usleep don't work because the context switching overhead. Right now I have a busy-waiting loop that uses clock_gettime with the CLOCK_MONOTONIC clock that constantly compares current time to the time before starting the loop and returning once the number of microseconds passed has elapsed. It works much better than using usleep, but can I get any better without writing kernel code (or switching to a real-time linux)? Thanks.</p>