[
https://issues.apache.org/jira/browse/LANG-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866708#comment-17866708
]
Gary D. Gregory commented on LANG-1747:
---------------------------------------
Hello [~o.b.fischer]
Some questions to consider:
* Does the API throw the exception from the lambda or catch it and include the
try-catch time in the measurement?
* Does the API return a Duration for the time measured?
* Suppose the API takes a Runnable (or FailableRunnable), should the API be
called "run"?
* Should the API also take a Callable that returns the value of the callable?
In this case, shouldn't it be called "call"?
* What happens if you call the API when the stopwatch is currently running?
* What happens if you call the API when the stopwatch is currently stopped?
* What happens if you call the API when the stopwatch is currently suspended?
* Same as above but from one or more threads?
> 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)