------- Comment #4 from jb at gcc dot gnu dot org 2007-05-19 17:51 ------- There are enough pitfalls with using rdtsc that I don't think it's justifiable to use it for a general purpose timing routine like system_clock. See e.g.:
http://www.ussg.iu.edu/hypermail/linux/kernel/0505.1/1463.html http://en.wikipedia.org/wiki/RDTSC http://lkml.org/lkml/2005/11/4/173 http://lwn.net/Articles/209101/ For a general purpose library like libgfortran I think the best way is to use something reasonably portable and consistent, and let the kernel people worry about providing a usable api such as gettimeofday or clock_gettime using whatever HW they deem the most appropriate behind the scenes. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15516