Radek Radek - 1 year ago 81
Javascript Question

measure processing time of AJAX call

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)

Answer Source
var start = new Date().getTime();
  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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download