-
Notifications
You must be signed in to change notification settings - Fork 18
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
FiniteDuration human representation #129
Comments
I like this option, seems to hit the debug use case and remain precise:
-
A method that returns a human readable string of the above. Keeping with
the example it would return:
23 days, 22 hours, 34 minutes, 53 seconds
…On Sat, Aug 20, 2022 at 12:41 AM Simão Martins ***@***.***> wrote:
When debugging/inspecting code with timeouts/ellapsed times/etc using
FiniteDuration seeing 2068493 seconds is not ergonomic, and in most cases
unhelpful.
I suggest adding either of these things (or even everything):
-
A method that returns the duration per unit of time (Map[TimeUnit,
Double]). For the example above it would be:
Map(
TimeUnit.DAYS -> 23,
TimeUnit.HOURS -> 22,
TimeUnit.MINUTES -> 34,
TimeUnit.SECONDS -> 53,
)
-
A method that returns a human readable string of the above. Keeping
with the example it would return:
23 days, 22 hours, 34 minutes, 53 seconds
-
An approximate human readable string: About 24 days. This method could
have some sort of max allowed error function.
—
Reply to this email directly, view it on GitHub
<#129>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXJZDQLVYKGILRO2TBWVDVZ6MJTANCNFSM57A7ISLQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This seems the most useful. The The approximate string wouldn't really be helpful for one of the most common places I could see using this: failing test case output. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When debugging/inspecting code with timeouts/ellapsed times/etc using FiniteDuration seeing
2068493 seconds
is not ergonomic, and in most cases unhelpful.I suggest adding either of these things (or even everything):
A method that returns the duration per unit of time (
Map[TimeUnit, Double]
). For the example above it would be:A method that returns a human readable string of the above. Keeping with the example it would return:
23 days, 22 hours, 34 minutes, 53 seconds
An approximate human readable string:
About 24 days
. This method could have some sort of max allowed error function.The text was updated successfully, but these errors were encountered: