As far as I know, the best portable equivalent of Intel rdtsc is: #include <time.h> clock_gettime(CLOCK_MONOTONIC, &ts)
It might not be quite as good as some architecture-specific methods, but there are some clever mechanisms in place on Linux to make it work accurately without a system call, so it's not at all bad. I'd suggest putting that in as a generic fall-back before worrying about what the best solution might be on particular architectures.

