title: Process.WaitForExit(Int32)
body: <p>Right now I am working on a Console Runner application that has the following code to output the log and to wait until the process is completed:</p>
  
  <pre><code>using (Process p = Process.Start(ps))
  {
      p.OutputDataReceived += OutputReceived;
      p.ErrorDataReceived += ErrorReceived;
      p.BeginOutputReadLine();
      p.BeginErrorReadLine();
      p.WaitForExit(30000);
      return p.ExitCode;
  }
  </code></pre>
  
  <p>I have two questions about this piece of code.</p>
  
  <ol>
  <li>I noticed that if the process takes longer than 30 seconds, the call p.ExitCode bombs.</li>
  <li>What happens if my process takes only 1 second, will it wait 30 seconds anyway or the process will be advised by the CLR?</li>
  </ol>