title: run setInterval for only 5 minutes?
body: <p>so I have the following code.</p>
  
  <pre><code> setInterval(function(){
            steamOfferObj.getOffer({
                "tradeOfferId": tradeOfferID["tradeofferid"] // The tradeoffer id
            }, function(error, body) {
                if (error == null) {
                  console.log(body);
                    if (body.response.offer.trade_offer_state == 3) {
                        return "Offer Accepted"
                    } else {
                        //on not accepted
                    }
                }
            });
        }, 5000);
  </code></pre>
  
  <p>basically it poles a steam trade offer to see if it has completed or not. However, this actually runs indefinitely, checking every 5 seconds until the program is time. What I was is for it to check every 5 seconds, for 5 minutes, after which it times out.</p>
  
  <p>Any way I could go about doing that?</p>