Measuring Processing Time of AJAX Calls in JavaScript

javascript

I want to measure how long it takes to process AJAX call. I have it up and running but don't know how to code this in javascript (js only)

Best Answer

var start = new Date().getTime();
doAjax({
  success: function() {
    var end = new Date().getTime();
    console.log('milliseconds passed', end - start);
  }
});

save a time value before you start doing ajax stuff, and then do it again when it finishes. Then subtract one form the other and get your time.

Related Question