|
gettimeofday() has microsecond resolution, so I don't think the problem is timer resolution.
After looking at the code, you might be better off determining how much time to wait, and calling usleep (instead of a busy wait loop). gettimeofday is a syscall, so there is a fair amount of overhead when calling that in a loop. Just a thought/suggestion.
|