Skip to content

Instantly share code, notes, and snippets.

View ashishsajwan's full-sized avatar
👋
Working from home

Ashish Sajwan ashishsajwan

👋
Working from home
View GitHub Profile
@ashishsajwan
ashishsajwan / intercept.js
Created September 6, 2016 09:51 — forked from suprememoocow/intercept.js
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;