Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to calculate time taken for ajax call in javascript

$.ajax({
    url: 'http://google.com',
    method: 'GET',
    start_time: new Date().getTime(),
    complete: function(data) {
        alert('This request took '+(new Date().getTime() - this.start_time)+' ms');
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calculate #time #ajax #call #javascript
ADD COMMENT
Topic
Name
8+4 =