Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: mogul@actitis.pa.dec.com (Jeffrey Mogul)
Subject: Re: gethrtime
Date: 1997/08/19	[thread overview]
Message-ID: <5tarq1$ghj@usenet.pa.dec.com> (raw)
In-Reply-To: qxp4t8tzawc.fsf@foobar.cs.colorado.edu


In article <qxp4t8tzawc.fsf@foobar.cs.colorado.edu>, Dirk Grunwald <grunwald@foobar.cs.colorado.edu> writes:
|> 
|> On SunOS systems, the 'gethrtime' function returns a high-resolution
|> (nano-second scaling) timer. It returns a 64-bit value.
|> 
|> On the alpha, you can use the RPCC instruction to get non-second
|> resolution, but it's only 32-bits. Does anyone have a package for a
|> 64-bit high-resolution time?

Dirk already knows the answer, but just in case anyone else
wants to know: look in the FAQ

	ftp://ftp.digital.com/pub/Digital/dec-faq/Digital-UNIX

where it says:
==============================================
P9. How can I get microsecond resolution from gettimeofday(2)?

Question: how does one get microsecond resolution from the
gettimeofday(2) system call?

Answer: Normally, Digital UNIX updates its internal idea of the
current time once per clock tick (1024 Hz, or about once per
millisecond).  In Digital UNIX V4.0 and later, it is possible
to rebuild the kernel to support approximately microsecond
resolution from the gettimeofday(2) system call, and from the
various library routines that use this system call.

To enable this option, add the following line to the kernel
configuration file and rebuild the kernel:

        options MICRO_TIME

The system clock (CLOCK_REALTIME) resolution as returned by
clock_getres(3) will not change.  Timer resolution remains the same.
However, the granularity of the time returned by gettimeofday(2) and
clock_gettime(3) will now be in microseconds. The time values returned
are SMP safe and monotonically increasing.

The high-resolution clock can be used for timestamping and for
measuring durations on the order of microseconds, such as time spent in
some critical code path.

==============================================

-Jeff



      reply	other threads:[~1997-08-19  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-13  4:00 gethrtime Dirk Grunwald
1997-08-19  4:00 ` Jeffrey Mogul [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox