Use the Process.WaitForExit() method instead of manually looping and testing for timeout.