How to find out how long a thread has been in the wait state
<p>Short version: In java, is there a way to find out how long a thread has been in the wait state? If it's relevant, the objects I'm referring to are sent into the wait state by a call to <code>condition.await()</code>.</p>

<p>Long version: (this is a homework problem)</p>

<p>I'm working on a program that creates 10 supplier threads and 10 consumer threads, with a synchronized common "meeting room." Supplier threads sleep for a bit, produce a random number, and (if the data field of the meeting room is empty), put the random number in that field and mark it for the consumer thread with the same id. If the data field is not empty, they <code>await</code> on an Occupied condition. Consumer threads check to see if the data in the meeting room is marked for them: If not, they <code>await</code> on a wrongID condition. If so, they 
they store the number in the data field, set it to null and call <code>Occupied.signalAll()</code> to notify the supplier threads that the data field is now empty. (Supplier threads call <code>wrongID.signalAll()</code> to notify consumer threads that new data is in the field).</p>

<p>I have several diagnostic <code>println</code> statements (Supplier 0 enters meeting room, leaves data / Supplier 1 enters waiting room...), and everything seems to be working fine. I would also like to print statements when threads wake up that displays how long they were in the wait state. Is this possible? </p>

<p>Also, if anyone sees any flaws in my logic here, feel free to point them out to me (this is one of my first forays into multithreading) </p>
