This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
_Jv_platform_nanotime
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Mon, 4 Sep 2006 16:39:55 +0100
- Subject: _Jv_platform_nanotime
Dude, how may nanoseconds in a second? :-)
Andrew.
2006-09-04 Andrew Haley <aph@redhat.com>
* posix.cc (_Jv_platform_nanotime): Correct scale factor.
Index: libjava/posix.cc
===================================================================
--- libjava/posix.cc (revision 116634)
+++ libjava/posix.cc (working copy)
@@ -87,12 +87,12 @@ _Jv_platform_nanotime ()
if (clock_gettime (id, &now) == 0)
{
jlong result = (jlong) now.tv_sec;
- result = result * 1000 * 1000 + now.tv_nsec;
+ result = result * 1000 * 1000 * 1000 + now.tv_nsec;
return result;
}
// clock_gettime failed, but we can fall through.
#endif // HAVE_CLOCK_GETTIME
- return _Jv_platform_gettimeofday () * 1000LL;
+ return _Jv_platform_gettimeofday () * 1000LL * 1000LL;
}
// Platform-specific VM initialization.