In Ajax is possible to calculate the processing time of the request? For example, if the extraction of data takes less than 3 seconds, to display a message and to enroll in logs by ajax. If possible you show me an example. P.S. Sorry for my bad english
2条回答 默认 最新
胖鸭 2016-05-10 12:35关注To get response time you can try something like this but as per this example you have to use jQuery.
var starttime = new Date().getTime(); jQuery.get('your-url-goes-here', data, function(data, status, xhr) { var requesttime = new Date().getTime() - starttime; } );解决 无用评论 打赏 举报