Re: Where is gethrtime()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ernesto L. Williams, Jr. <ernesto@xxxxxxxx> 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@xxxxxxxxxxxxx  -
- 155 S 1400 E RM 233                       beebe@xxxxxxx  beebe@xxxxxxxxxxxx -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux