I want to calculate average execution time for WX search from all the "Elapsed Time" values in logs using C sharp?
<p>log file format is :</p>

<blockquote>
  <p>WX Search = Server:yukon.corp.adobe.com User:adoda appGUID: wx
  Elapsed Time:16090ms  WX Search = Server:yukon.corp.adobe.com
  User:adoda appGUID: wx Elapsed Time:16090ms  WX Search =
  Server:yukon.corp.adobe.com User:karansha appGUID: wx Elapsed
  Time:16290ms  WX Search = Server:yukon.corp.adobe.com User:ravsingh
  appGUID: wx Elapsed Time:16190ms  WX Search =
  Server:yukon.corp.adobe.com User:adoda appGUID: wx Elapsed
  Time:16290ms  WX GSA Search = Server:yukon.corp.adobe.com User:adoda
  appGUID: wx Elapsed Time:16290ms  WX GSA Search =
  Server:yukon.corp.adobe.com User:adoda appGUID: wx Elapsed
  Time:16290ms  WX GSA Search = Server:yukon.corp.adobe.com User:adoda
  appGUID: wx Elapsed Time:16290ms</p>
</blockquote>

<p>First i will have to search for lines and return lines that contains "WX Search". After that from these lines i will have to look for "Elapsed Time" values.
 And finally calculate their average.</p>

<p>Such that i get stats as : Average execution time</p>

<p>Code that i have tried so far is :</p>

<pre><code>string searchKeyword = "WX Search";
        string fileName = "C:\\Users\\karansha\\Desktop\\search tab.txt";
        string[] textLines = File.ReadAllLines(fileName);
        List&lt;string&gt; results = new List&lt;string&gt;();
        foreach (string line in textLines)
        {
            if (line.Contains(searchKeyword))
            {
                results.Add(line);
            }
        }
</code></pre>

<p>For average execution time i am not able to figure out the code. Need help.</p>
