title: How can I profile threads in Java?
body: <p>I have producer and consumer threads in my application and I need to profile them to see the performance of the threads, time taken before each goes to sleep and waits, etc., and take corrective action to improve the over all efficiency of the application.</p>
  
  <p>Any suggestions on how to go about this?</p>