[ 
https://issues.apache.org/jira/browse/LANG-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866794#comment-17866794
 ] 

Oliver B. Fischer commented on LANG-1747:
-----------------------------------------

[~ggregory] This was only a rough draft. I think the API should support also 
throwing exceptions. The implementation should only a wrapper arount the actual 
code to be executed. Taking time should not change the code execution, as 
mostly time measurement is added afterwards.

Taking time should only be possible if the watch has been stopped.

If my suggestion has a good change of being accepted with a good implemetation, 
I would like to provide a draft implementation.

> 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)

Reply via email to