-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Modify get_time_info() to return seconds and nanoseconds #445
Modify get_time_info() to return seconds and nanoseconds #445
Conversation
Removed outdated "TODO: Clarify newlib's handling of time units" comments as the time unit conversion error in newlib was fixed in v4.4.0 [1]. Link: https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=5f15d7c5817b07a6b18cbab17342c95cb7b42be4 [1]
The current get_time_info() helper function returns seconds and microseconds, which reduces the resolution of rv_clock_gettime() (which has nanosecond resolution). This change updates get_time_info() to return seconds and nanoseconds to maintain higher resolution.
Thank @visitorckw for contributing! |
@visitorckw, I found the results of some tests like |
Absolutely. When I discovered the errors in newlib libgloss, @jserv asked me to correct the time-related system calls in rv32emu and also update all the binaries. However, I remember that when I applied my newlib patch and compiled the riscv gnu toolchain to generate the test binaries for rv32emu, I encountered an |
Additionally, I believe the weird results you observed are due to the change in time units introduced by PR #360 , not this PR. This PR merely optimized the precision without changing the time units. |
Yes, I have found that I replied the wrong one. I sorted the PRs with created time and not realized it. 🥲 |
That's fine. Replying to either one is fine.
Do you have any idea about this error? |
I encountered this error back in November or December of last year. This issue has indeed been pending for quite a while without resolution. If we still can't identify the cause of this error, perhaps I could write a script to perform a bisection on the riscv gnu toolchain to try and find the cause. |
I add |
…olution Modify get_time_info() to return seconds and nanoseconds
Modify get_time_info() to return seconds and nanoseconds to get higher time resolution. Additionally, remove the outdated TODO comments as it was solved in newlib v4.4.0 [1].
Link: https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=5f15d7c5817b07a6b18cbab17342c95cb7b42be4 [1]