Can you know the response time of an AJAX request with jQuery?


I wanted to know if there is any function that returns the AJAX request time in microseconds, because I need to get this value for the project I'm developing.


You need to keep a timestamp from the time of the request, get another one at the time of the response, and compare the two:

var inicio =;
$.get('').done( function(response) {
    var tempo = - inicio;
    console.log('A requisição levou ' + tempo + 'ms');
<script src=""></script>

The time is in milliseconds, but note that it has decimal places. This is only possible with , which is not supported in older browsers, instead of Date.getTime() , which has no support issues.

Scroll to Top