-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graal js new Date() millisecond is not equals to the system date #6939
Comments
Hi, thank you for reporting this, could you please share some details on what GraalVM version you're using? and which OS? |
OS: Windows 10 Eg: At the beginning, there will be a few milliseconds difference, and after running for a few days, there will be a few seconds difference. |
Hi, could you please verify if this is still occurring on the latest version of Oracle GraalVM for JDK21 & JDK17. If yes, please share a full reproducer with steps to reproduce that we can follow to verify and debug the issue. Thank you |
Hello, I have tested version graalvm 23.0.2 and the issue still persists. |
@oubidar-Abderrahim |
|
Please run the following code in Graalvm JS do { |
To my knowledge, javascript is an asynchronous language. So I am not sure how you can guarantee that jsDate is executed after javaDate? |
Because the code line |
@iamstolis could you please take a look here, Thank you |
While this may be confusing, it is not necessarily a sign of a problem. Note that even
So, you see the time combined from these timers to jump back and forth despite there is no bug in them. In other words, I am not concerned by these tiny deviations that your test-case shows. On the other hand, I am concerned by the fact that you saw the difference of several seconds in a long running application. I can imagine how this can happen and it seems to be a bug in our implementation. Our internal (nano) timer is implemented as |
@iamstolis |
I have modified the built-ins that return the current time to use |
That's great! Thanks @iamstolis for the update. |
The millisecond time of Graal's new Date() is not equal to the system time, and as time goes on, the time difference will become larger and larger
The text was updated successfully, but these errors were encountered: