Linux has clock_gettime()
Use it with CLOCK_MONOTONIC, and it should give you nanosecond resolution.
Hmmm... That's what I use, but with CLOCK_REALTIME. Do you know why one is preferable over the other?
EDIT: After a bit of searching, it seems CLOCK_MONOTONIC will behave better if the clock is adjusted (say, by ntpd).