System.currentTimeMillis() compile to native, accurate?

Andrew Haley aph@redhat.com
Thu Feb 9 16:07:00 GMT 2006


Rui Wang writes:

 > I wonder that how gcj maps Java's "System.currentTimeMillis()" to native
 > machine code. 

It calls 

  timeval tv;
  gettimeofday (&tv, NULL);
  return (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL);

It's as accurate as gettimeofday(2).

Andrew.



More information about the Java mailing list