title: How to "sleep" until timeout or cancellation is requested in .NET 4.0
body: <p>What's the best way to sleep a certain amount of time, but be able to be interrupted by a <code>IsCancellationRequested</code> from a <code>CancellationToken</code>?</p>
  
  <p>I'm looking for a solution which works in .NET 4.0.</p>
  
  <p>I'd like to write</p>
  
  <pre><code>void MyFunc (CancellationToken ct)
  {
     //... 
     // simulate some long lasting operation that should be cancelable 
     Thread.Sleep(TimeSpan.FromMilliseconds(10000), ct); 
  }
  </code></pre>