I want to kill a process running on the machine using taskkill if they\'re still running after X seconds (a windows service was stopped but it takes time for processes to diss
You could call Process.WaitForExit, passing the appropriate timeout. This way you won't need to use your own check to see whether the process is still running.