title: Break the function after certain time
body: <p>In Python, for a toy example:</p>
  <pre><code>for x in range(0, 3):
      # Call function A(x)
  </code></pre>
  <p>I want to continue the <code>for</code> loop if function A takes more than five seconds by skipping it so I won't get stuck or waste time.</p>
  <p>By doing some search, I realized a subprocess or thread may help, but I have no idea how to implement it here.</p>