Hi, in my business logic i have a method that should be stopped if the execution takes longer then a second.
Something like this:
For testcases there is the @Timed method. How to implement smth. like tihs?
public int doCheck(final String condition)
final int result;
result = calculate(condition);
catch (final TimeoutException e)
resut = UNKNOWN;
private int calculate(final String condition)
// Calculate ... (if it takes longer then 1 sek. a timeoutException should be thrown)
return // calulated result.
Thanks a lot,