-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Support custom TimeUnits in StopWatch #25813
Conversation
provide getLastTime, getTotalTime, modifie print format for tasks include default TimeUnit in nanoseconds
Precisely what I was looking for. I don't know how many nanoseconds are in one second, so this will simplify my life. |
Update fork
# Conflicts: # spring-core/src/test/java/org/springframework/util/StopWatchTests.java
The function itself is implemented, but it hasn't passed the CI yet. So won't this PR be merged in the foreseeable future? It is very useful for debugging and I would like to use it in a version, so when will this PR be merged? @ak98neon |
@ventulus95 it's in the general backlog so there's no commitment on our end. That said, I am not sure we should implement it this way. We could reuse |
I don't see the need for a new group of TimeUnit-based accessors and see them as rather confusing next to our existing That said, I do see the point with That aside, there is the question of |
See #25803 (comment) for a summary of the 6.1 revision. This ended up preferring Thanks for the pull request and the specific proposal! This turned into very useful inspiration, I hope the end result is appropriate for your purposes. |
Add
TimeUnit
support inStopWatch
util class.StopWatch#getLastTime
andStopWatch#getTotalTime
TimeUnit
in nanosecondsSee #25803