I would like to get the duration for a certain ajax request using jquery. For instance I am using this script:
$.ajax({
type: "GET",
url: "http://localhost/thescript.php",
success: function(data){
$("#container").html(data);
},
complete: function(jqXHR, textStatus){
alert("http://localhost/thescript.php took 'n' seconds to load");
}
});
I would like to be able to know how long this ajax script loaded the url "http://localhost/thescript.php". For instance alert: "http://localhost/thescript.php took 'n' seconds to load".