title: Implement C# Generic Timeout
body: <p>I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.</p>
  
  <pre><code>TemperamentalClass tc = new TemperamentalClass();
  tc.DoSomething();  // normally runs in 30 sec.  Want to error at 1 min
  </code></pre>
  
  <p>I'm looking for a solution that can elegantly be implemented in many places where my code interacts with temperamental code (that I can't change).</p>
  
  <p>In addition, I would like to have the offending "timed out" code stopped from executing further if possible.</p>