title: How do I take a Task<T> and put a timeout on it?
body: <p>My other question basically needed this so I thought I would share my generic solution here. </p>
  
  <p>I had trouble with HttpClient Tasks for web requests basically never completing; so the program or thread hangs. I needed a simple way to add a timeout to a task, so that it returns normally or returns cancelled if the timeout expires first.</p>
  
  <p>Some alternative approaches can be found here:
  <a href="http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx" rel="nofollow">http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx</a></p>