How to set an interval, but then stop it after 20 minutes
<p>Currently on my webpage I have a timer that runs a function every 30 seconds:</p>

<pre><code>setInterval("someFunction(userId)", 30000);   
</code></pre>

<p>This works fine, but the problem is if 100's of users leave their browser open (say when they go for lunch), it will poll our system and increase the load on our servers for no reason.</p>

<p>How can I stop this timer from running after say 20 minutes?</p>
