title: Time limit for an input
body: <p>Suppose I have a code where it asks the user to give some input, something like this:</p>
  
  <pre><code>for (condition) {
  System.out.println("Please give some input");
  System.in.read();
  } //lets say this loop repeats 3 times and i face a problem during second iteration
  </code></pre>
  
  <p>but I want to give the user a 60 second time limit, and then throw an exception (in this case, I think its <code>TimeOutException</code>). How do I do that?</p>