Seisei Itahashi <sei...@csg.ci.i.u-tokyo.ac.jp> wrote on 04/09/2014
07:48:31 AM:
>
> In "System" class, there are methods called "currentTimeMillis()" and
> "nanoTime()", that display timestamp(time passed from 1970).
>
> In C++ backend, when I perform the following source code, the timestamp
> displayed on console starts with the number "173"., while it starts with
> the number "139" when running the same source code on Terminal (compiled
> by myself with x10c++).
> In Java backend, on both X10DT and Terminal (compiled by myself with
> x10c), the timestamp starts with "173".
>
> The correct timestamp must be the number that start with "139", so it
> displays the correct timestamp only when I compiled the source code with
> x10c performed on the Terminal.
>
> For example, 1736762334 was displayed when I did run the following
> source code on X10DT with C++ backend. What does this number mean?
>
>
> public class Hello {
> public static def main(Rail[String]) {
> Console.OUT.println(System.currentTimeMillis());
> }
> }
Hi,
In the C++ backend implementation of currentTimeMillis we were
incorrectly calling the same clock as we use for nanoTime (and scaling to
millis). So on most systems the C++ backend implementation of
currentTimeMillis was returning the result of clock_gettime on either
CLOCK_MONOTONIC or CLOCK_REALTIME in milliseconds.
To be consistent with the Java backend, I changed the C++ backend
implementation of currentTimeMillis to instead always call gettimeofday and
return the result in milliseconds. Committed just now to trunk (r27618).
--dave
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users