2

Is there a way to get an xmlHttpRequest load time?

Otherwise I'll have to set a function that count it, so?

Geo
  • 12,666
  • 4
  • 40
  • 55
R. 久蔵
  • 187
  • 2
  • 5
  • 16

1 Answers1

5

To the best of my knowledge there isn't an execution time included as part of the XMLHTTPRequest object. You can, however, use JS to calculate this value:

const start = Date.now();

// Execute request

alert( "Request took: " + ( Date.now() - start ) );

For more info on the data that is stored in the XMLHTTPRequest object, see this page.

lucascaro
  • 16,550
  • 4
  • 37
  • 47
ShaneC
  • 2,376
  • 4
  • 19
  • 27