JSFiddle - React, Tailwind, and code Playground
JavaScript
var url = 'https://github.com/settings/profile';
var req = new Request(url, { credentials: 'include', mode: 'no-cors'});
fetch(req).then(
function(response) {
// first byte of `response` received!
T1 = performance.now();
console.log('T1=' + T1);
}
);
setInterval(function() {
var entries = performance.getEntries();
//console.log(entries);
var lastEntry = entries[entries.length - 1];
if (lastEntry.name == url) {
T2minT1 = lastEntry.responseEnd - T1;
console.log('T2minT1=' + T2minT1);
}
}, 1);