INNER CODE UNIT · JavaScript
computeTimings
cyrus-and/chrome-har-capturer · lib/har.js:195
function computeTimings(entry) {
// handle the websocket case specially
if (entry.isWebSocket) {
// from initial request to the last frame, this is obviously an
// approximation, but HAR does not directly support WebSockets
const sessionTime = (
entry.frames.length === 0 ? -1 :
toMilliseconds(entry.frames[entry.frames.length - 1].time - entry.requestParams.timestamp)
);
return {
time: sessionTime,
timings: {
blocked: -1,
dns: -1,
connect: -1,
send: 0,
wait: sessionTime,
receive: -1, // XXX does not really make sense for WebSockets...