title: Setting a time limit to a function
body: <p>(Nodejs) I am writing a web scraper that is running through some pages, takes screenshots etc. But sometimes the program takes way too long or even gets stuck sometimes, low internet speed, connection breaks, library bugs...
  I need to handle these cases where a specific function took more than lets say 30 seconds.
  My function is something like this:</p>
  
  <pre><code>    const simpleFlow = async () =&gt; {
        await process1();
        await process2();
        await process3();
      }
  </code></pre>