can someone please explain what is happening in this javascript code?
<p>I want the browser to display the seconds since it was last refreshed. I don't understand why 
Code 1 does not work;
Code 2 does;
If code 1 does not work why does code 3 work? The <code>setInterval</code> call is similar in CODE 1 and CODE 3. The way the function is defined is different. But it is not clear to me why that is making a difference. </p>

<p>Thanks very much for your help. I have just started learning JavaScript.</p>

<p><strong>CODE 1</strong></p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Time Since Refresh&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span id="timeSinceStart"&gt;&lt;/span&gt;

&lt;script language="JavaScript"&gt;
    var timeRefreshed = new Date();
    function displayTimeSinceStart(){
        var now = new Date();
        //compute elapsed time
        var elapsed = Math.round((now - timeRefreshed)/1000);
        document.getElementById("timeSinceStart").innerHTML = "Time Elapsed: " + elapsed + " seconds."; 
    }

    // Update seconds counter
    setInterval(displayTimeSinceStart(), 1000);

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>CODE 2</strong>
Same as CODE 1, except the <code>setInterval()</code> function is written as</p>

<pre><code>setInterval("displayTimeSinceStart();", 1000);
</code></pre>

<p><strong>CODE 3</strong></p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Time Since Refresh&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span id="timeSinceStart"&gt;&lt;/span&gt;

&lt;script language="JavaScript"&gt;
    var timeRefreshed = new Date();
    var timeSinceStart = {
        displayTimeSinceStart: function(){
            var now = new Date();
            //compute elapsed time
            var elapsed = Math.round((now - timeRefreshed)/1000);
            document.getElementById("timeSinceStart").innerHTML = "Time Elapsed: " + elapsed + " seconds."; 
        }
    }

    // Update seconds counter
    setInterval(timeSinceStart.displayTimeSinceStart, 1000);

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
