This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/15516] assembly snippets for nano second resolution wall clock time
- From: "jb at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2007 16:51:35 -0000
- Subject: [Bug libfortran/15516] assembly snippets for nano second resolution wall clock time
- References: <bug-15516-8569@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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