R. 久蔵
R. 久蔵

Reputation: 187

ajax get xmlHttpRequest load time

Is there a way to get an xmlHttpRequest load time?

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

Upvotes: 2

Views: 3455

Answers (1)

ShaneC
ShaneC

Reputation: 2406

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.

Upvotes: 5

Related Questions