This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

_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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]