This code loads two parameters from a PHP file and prints them on the screen every second, but does that not use too much cpu/memory power to run it? How can that be avoided? I want to free/release or autorelease the memory it's using, while it's updating, but I don't know how... Please help me out guys.
function updateStats(stat) {
var stat = ["NAME","ID"];
var url = "USERS.php";
$.each(stat, function(i, key){
$.post(url, {stats: key}, function(data) { // stats to stat
$("#" + key).html(data);
});
});
}
setInterval(function(){
updateStats("updateStats");
}, 1000);