title: How can I get TaskExecutionTime in C# Task Parallel Library?
body: <p>I'm using Task Library and using Wait with timeout parameter. How can I set taskExecutionTime?</p>
  
  <pre><code>int taskExecutionTime=5000;
  try
  {
      bool hasTimeout=!myTask.Wait(5000);
      if (!hasTimeout)
         taskExecutionTime=???     
  }
  catch (AggregateException)
  {
      taskExecutionTime=???
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I don't need real time performance of myTask. For example I'm using .NET's HtpWebRequest with different proxies. I want to know and compare proxy performances. Generic solution will be better, so everyone of us can use it.</p>