[
https://issues.apache.org/jira/browse/LANG-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17870750#comment-17870750
]
Oliver B. Fischer commented on LANG-1747:
-----------------------------------------
Hi [~ggregory],
I would like to discuss with you the handling of the state of a stop watch.
Currently each method starts or resumes the stop watch and after the execution
the stop watch will be suspended.
The idea behind this behavior is, that the watch will be used to take only the
time of the execution of the given function.
The current implementation implies for example that the wrapped function will
not be passed around.
Futhermore the implementer must be aware of this. I think the best place to
document this is the JavaDoc for the stop watch.
What do you think? Is the behavior as it is implemented ok?
> Add support for actions to simplify the measurement of times
> ------------------------------------------------------------
>
> Key: LANG-1747
> URL: https://issues.apache.org/jira/browse/LANG-1747
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.time.*
> Reporter: Oliver B. Fischer
> Priority: Major
>
> As a developer, I would like to be able to use a stop watch with modern
> language features, so that I can measure the time recuired for
> {{{}Runable{}}}s or {{{}Supplier{}}}s or similar stuff.
> I would like to be able to write code similar to this example
> {code:java}
> StopWatch watch = StopWatch.create();
> watch.takeTime( () -> { ...} )
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)