title: In Java: how can I make thread watch over another thread?
body: <p>Sorry if the question is quite simple. I am a beginner.</p>
  
  <p>I have to create thread that calulates something, while the first thread works the other one have to measure if the first thread calculate the function in specified time. If not, it has to throw exception. Else it returns the answer.</p>