date: implement --resolution flag#8686
Merged
cakebaker merged 6 commits intouutils:mainfrom Sep 22, 2025
Merged
Conversation
7d97ae4 to
2aafa61
Compare
2aafa61 to
64c72d7
Compare
CodSpeed Performance ReportMerging #8686 will create unknown performance changesComparing Summary
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Contributor
Author
|
I'm not sure how best to solve the redox os issue. Redox doesn't support the |
|
GNU testsuite comparison: |
Contributor
|
Thanks for your PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
--resolutionflag fordate. On unix platforms this uses the posix functionclock_getres. I could not find an equivalent syscall on windows, however every windows operating system since at least Windows 2000 has used a resolution of 100ns, so I decided to hardcode that as the returned resolution.I treated the
--resolutionflag as a date source like it is in GNU date, this allows other formatting flags to apply to the output of the--resolutionflag. I also tried to make sure the implementation would interact well with a future implementation of the--debugflag.As a bit of a drive by I also add conflicts_with annotations to the four date source options, this is to make the GNU date behaviour of failing when multiple date sources are specified. However, I'm not sure if I've taken the best approach for this, since the error message is different to GNU make and I'm not sure whether or not this is an issue.
fixes #6143