title: Pause the program to check variable values in C#
body: <p>I am running a C# console application which for example is the following:</p>
  
  <pre><code>int sum=0;
  for (i=1;i&lt;100000000;i++)
  {
      sum+=getSomeAlmostRandomValue();
      // if (i%10000==0)
      // Console.WriteLine(sum/i);
  }
  </code></pre>
  
  <p>In simple words, i want to check the average of the results for a big number of iterations.</p>
  
  <p>At some times, i want to check the average so far, to see how it is going... But checking the IF condition every time in the iteration, is probably too dumb/time-consuming. (This is just an example to introduce my problem. I know that i can break the for loop into 2 nested for loops in order not to have the IF. But still, maybe i don't want to WriteLine every some iterations). So my real question is the following:</p>
  
  <p>Is there a way (by deleting the 2 commented rows) <strong>to pause the program at will</strong> and check the value of my variables (i,sum)</p>