title: Alternative to JavaScript's setInterval?
body: <p>I need my contents to be shown in real-time, but when loading this many things it takes up so much CPU and is very laggy.</p>
  
  <p>Is there an alternative to my code below? </p>
  
  <pre><code>$(document).ready(function() {
      var refresh_bal = setInterval(
          function (){
              $.get('./php/get_balance.php', function(balance) {
                  $('.balance').html(balance);
              });
          }, 1000);
  
      var refresh_total = setInterval(
          function (){
              $.get('./php/get_total_bets.php', function(total) {
                  $('.total').html(total);
              });
          }, 1000);
  
      var refresh_profit = setInterval(
          function (){
              $.get('./php/get_profit.php', function(profit) {
                  $('.profit').html(profit);
              });
          }, 1000);
  
      $('.haa').on('click', function() {
          var refresh_bets = setInterval(
              function (){
                  $.get('./php/get_bets.php', function(bets) {
                      $('.betsTable').html(bets);
                  });
              }, 1000);
      });
  
      var refresh_site = setInterval(function (){
          $.get('./php/get_site.php', function(site) {
              $('.siteStats').html(site);
          });
      }, 1000);
  
      var refresh_client = setInterval(function (){
          $.get('./php/get_client.php', function(client) {
              $('.clientShow').html(client);
          });
      }, 1000);
  
      var refresh_server = setInterval(function (){
          $.get('./php/get_server.php', function(server) {
              $('.serverShow').html(server);
          });
      }, 1000);
  
      $('.ha').on('click', function() {
          var refresh_chat = setInterval(function() {
              $.get('./php/get_chat.php', function(chats) {
                  $('.chats').html(chats);
              });
          });
      });
  });
  </code></pre>