title: How += is more optimized that normal expression
body: <p>I read somewhere that:</p>
  
  <p><strong>Good Practice:</strong> <code>exp += val</code>
  <strong>Bad Practice:</strong> <code>exp = exp + val</code></p>
  
  <p>The second options forces the JIT to evaluate both copies of <code>exp</code>, and many times this is not needed. The first statement can be optimized far better than the second, since the JIT can avoid evaluating the exp twice.</p>
  
  <p>So I wrote a sample test to verify this. But I am getting a result that I can conclude something. Can anyone help me out to understand if above one is good or bad practice OR I have any bug in my example.</p>
  
  <pre><code>        static void Main(string[] args)
      {
          DateTime startTime;
          DateTime endTime;
  
          for (int run = 0; run &lt; 10; run++)
          {
              Console.WriteLine("--- Run #" + run.ToString());
              long sumB = 0;
              startTime = DateTime.Now;
              for (long i = 0; i &lt; 1000000000; i++)
              {
                  sumB = sumB + 2L;
              }
              endTime = DateTime.Now;
              Console.WriteLine(endTime - startTime);
  
              long sumA = 0;
              startTime = DateTime.Now;
              for (long j = 0; j &lt; 1000000000; j++)
              {
                  sumA += 2L;
              }
              endTime = DateTime.Now;
              Console.WriteLine(endTime - startTime);
          }
  
          Console.WriteLine("*");
          Console.ReadKey();
      }
  </code></pre>