title: How to measure performance of a managed thread in .NET
body: <p>I want to measure performance of a managed (.NET) thread. To be specific, I need to measure following -</p>
  
  <ol>
  <li><p>How long the thread is using CPU?</p></li>
  <li><p>How long it remained blocked (waiting for completion of a remote method call)?</p></li>
  </ol>
  
  <p>Using System.Diagnostic.StopWatch is not helpful, becuase it reads high resolution performance timers feature of OS/Hardware which may include time consumed by other threads running parallely and sharing the same CPU.</p>