title: How to implement a efficient timeout in java
body: <p>There are <code>n</code> object which perform some actions. After performing an action a timestamp will be updated. Now I want to implement a timeout-thread which verifies if a timestamp is older than for example 60 seconds. </p>
  
  <p>My first solution was to do that with a thread (while-loop + sleep) which is holding a list with all objects including the last timestamp. Now I have the problem that there is a worst-case scenario where the thread needs 59 seconds plus sleep time to decide for a timeout.</p>
  
  <p>I’m searching for a solution like a Timer where it is possible to update the delay time. </p>
  
  <p>Any ideas?</p>