Add logging timing output.

This commit is contained in:
Dillon Kearns 2022-08-18 20:19:11 -07:00
parent d45a3aff71
commit 1b3c7b8ce8

View File

@ -95,6 +95,7 @@ function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
}
} else {
try {
console.time(`fetch ${request.url}`);
const response = await fetch(request.url, {
method: request.method,
body: request.body,
@ -103,6 +104,8 @@ function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
...request.headers,
},
});
console.timeEnd(`fetch ${request.url}`);
const expectString = request.headers["elm-pages-internal"];
if (response.ok || expectString === "ExpectResponse") {