Time diff code is not working
<p>Here I want to find total time spent by user on a page.</p>

<p>For that i am using following code but this is not working.
I am using jquery1.8. Please  see it.</p>

<pre><code>var enterTime;
var endTime;
var diffTime; 
$(document).ready(function (e) {
            enterTime=e.timeStamp;

        });

        $(window).bind('beforeunload', function(f){
            endTime=f.timeStamp;
         diffTime=endTime-enterTime;
        alert(diffTime);
       });
</code></pre>
