You can use the beforeSend()
and complete()
functions to compare the current timestamps and calculate the difference.
http://api.jquery.com/jQuery.ajax/
Here you can see all callback hooks provided by $.ajax
:
http://api.jquery.com/jQuery.ajax/#callback-functions