Show compound units in elapsed time display.#87
Open
wtn wants to merge 1 commit into
Open
Conversation
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.
When logging from a long-running script, I'll get many messages in a row that all show
1h. It would be nice to have a minute column, so I can see elapsed time between events at a glance.So following up on #84, I suggest to show compound units in the elapsed time display. Instead of collapsing to a single coarse unit, each range past 60 seconds keeps sub-unit resolution and aligns vertically in a fixed-width format.
Examples
Existing
Proposed
The unit divider (
.,m,h,d) stays in the third column, so the field still reads cleanly down the column. Past 99 days it falls back to bare days (100d,1000d) to stay within the six-column width.Clock.formatted_durationalso feeds the progress summary sentence, which now readscompleted in 2m05s, 1m02s remaininginstead of2m, 1m. (If this change is not desired, the implementations can be separated.)Types of Changes
Contribution
addedupdated tests for my changes.