This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Where is gethrtime()?
- From: "Nelson H. F. Beebe" <beebe at math dot utah dot edu>
- To: GCC-Help <gcc-help at gcc dot gnu dot org>
- Cc: beebe at math dot utah dot edu
- Date: Mon, 24 Oct 2005 06:29:22 -0600 (MDT)
- Subject: Re: Where is gethrtime()?
Ernesto L. Williams, Jr. <ernesto@ornl.gov> asks about the
availability of high-resolution timers, and whether the gethrtime()
function is found only on Solaris.
Although this question is off-topic on the gcc-help list, it may
nevertheless be of interest to readers, because it is question that
many of us have probably raised, and for which Unix vendors and
programming-language standards bodies have provided little help.
Today, with GHz clocks on modern processors, the 60 and 100 ticks per
second of the default CPU timer is completely inadequate for serious
profiling.
The profiling version of awk, pawk, that I prepared in 2002 has some
notes and code on the topic. This is an interest of mine, and pawk is
available at:
ftp://ftp.math.utah.edu/pub pawk
http://www.math.utah.edu/pub/pawk
There are implementations in pawk of high-resolution timers in
cpuclock.c for GNU/Linux on PowerPC, Sun Solaris, and for the
DEC/Compaq/HP Alpha architecture. The files README.PROFILE, mail.txt,
and TIMER.NOTES record additional information that I collected.
If others on this list of new information to contribute that would
extend coverage to other platforms, I'll be happy to make an updated
version of cpuclock.c, and prepare an improved version of the
TIMER.NOTES file.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.edu -
- 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------