Popular recipes tagged "subprocesses"http://code.activestate.com/recipes/tags/subprocesses/popular/2008-09-24T11:34:52-07:00ActiveState Code RecipesTiming an external subprocess (Python)
2008-09-24T11:34:52-07:00Benjamin Hallhttp://code.activestate.com/recipes/users/4167286/http://code.activestate.com/recipes/576514-timing-an-external-subprocess/
<p style="color: grey">
Python
recipe 576514
by <a href="/recipes/users/4167286/">Benjamin Hall</a>
(<a href="/recipes/tags/running_external_programs/">running_external_programs</a>, <a href="/recipes/tags/subprocesses/">subprocesses</a>).
</p>
<p>Running separate processes with os.system() has a single major disadvantage for the work I'm doing, and that is the external program is prone to entering a state where it stops producing any output. The "wallclock" subroutine runs an external command and periodically checks to see if it has finished, killing it if it runs for too long.</p>