title: Optimize and improve timed function in background
body: <p>I'm working on an extension for Chrome Browser and Opera browser.
  I have a part of the code in the background.js file that I think is not optimized and use too much resource. Currently with only the browser opened and the extension installed the browser use 0.5/1 percent of CPU.</p>
  
  <p>My code is something like this:</p>
  
  <pre><code>    setInterval(function()
  {
      $.getJSON( "link of json", function( data ) {
  
      if(data.length &gt; 10)
      {
          showNotification(str);
      }
  
      });
  }, 30000)
  </code></pre>
  
  <p>Every 30 seconds the extension do a request for a json file, and after check the if. The extension use that CPU without entering in the if.</p>
  
  <p>There is a way to optimize or do in a better way this type of code?</p>