why setinterval slows down the website
<p>I am using this simple function  but it much skows down the web site depending on the time the webpage has been opened.when user refresh  or goes to another page,it takes much time to refresh.</p>

<p>I am basically fecthing the user new posts.so time must keep running.</p>

<p>If i dont use this function then webpage loads quickly.Although this is a simple function
Plz help or suggest any alternarive approach.</p>

<pre><code>$(document).ready(function() {
   setInterval( "timer();", 1000 );
});

function timer(){
    $.post('sendchat2.php', {option:'timer',id= $('#timer').val()}, function(data) {
        $('#timer').html(data);

    })
}
</code></pre>
