Commit bd4ca424 by Tom Tromey Committed by Tom Tromey

posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC and CLOCK_HIGHRES.

	* posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC and
	CLOCK_HIGHRES.

From-SVN: r112494
parent c2a64439
2006-03-29 Tom Tromey <tromey@redhat.com>
* posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC and
CLOCK_HIGHRES.
2006-03-28 Anthony Balkissoon <abalkiss@redhat.com>
* scripts/unicode-muncher.pl: Removed this file.
......
......@@ -71,7 +71,15 @@ _Jv_platform_nanotime ()
{
#ifdef HAVE_CLOCK_GETTIME
struct timespec now;
if (clock_gettime (CLOCK_REALTIME, &now) == 0)
int id;
#ifdef CLOCK_MONOTONIC
id = CLOCK_MONOTONIC;
#elif defined (CLOCK_HIGHRES)
id = CLOCK_HIGHRES;
#else
id = CLOCK_REALTIME;
#endif
if (clock_gettime (id, &now) == 0)
{
jlong result = (jlong) now.tv_sec;
result = result * 1000 * 1000 + now.tv_nsec;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment