Skip to content

Commit

Permalink
Do this instead
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 27, 2024
1 parent 7decc08 commit efc8347
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function withServer(action: (serverUrl: URL) => Promise<void>) {
async onListen(details) {
const url = new URL(`http://${details.hostname}:${details.port}/`);
try {
const startTime = Date.now();
const startTime = new Date();
await action(url);
const endTime = Date.now();
const endTime = new Date();
await server.shutdown();
const endShutdownTime = Date.now();
const endShutdownTime = new Date();
// deno-lint-ignore no-console
console.log("Start", startTime, "End", endTime, "Shutdown", endShutdownTime);
resolve();
Expand All @@ -27,7 +27,7 @@ function withServer(action: (serverUrl: URL) => Promise<void>) {
}, (request) => {
count++;
// deno-lint-ignore no-console
console.log("IN", count);
console.log("IN", count, new Date());
try {
const url = new URL(request.url);
if (url.pathname === "/text-file") {
Expand All @@ -50,7 +50,7 @@ function withServer(action: (serverUrl: URL) => Promise<void>) {
} finally {
count--;
// deno-lint-ignore no-console
console.log("OUT", count);
console.log("OUT", count, new Date());
}
});
});
Expand Down

0 comments on commit efc8347

Please sign in to comment.