How long does my AJAX call take?
<p>I want to do something like</p>

<pre><code>var date = new Date();
var pretime = date.getTime();

$.post(    
    "ajaxfile.php", 
    object, 
    function(data) {
        var totalTime = date.getTime()-pretime;
        $("#feed").append("Time: " + totalTime + "&lt;br/&gt;" + pretime + "&lt;br/&gt;" + date.getTime() + "&lt;br/&gt;");
    });
});
</code></pre>

<p>That is, measure how long the AJAXcall lasts before I get a response. But the print from this callback function is:</p>

<pre><code>Time: 0
1326184886814
1326184886814
</code></pre>

<p>What is the solution to this?</p>
