tcp/quic lab patched again

This commit is contained in:
2026-01-10 11:01:24 +08:00
parent b09a29b7e8
commit 553a2c7f3a
5 changed files with 14 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -117,7 +117,21 @@ int main(int argc, char *argv[]) {
quiche_conn *conn = client->conn;
if (quiche_conn_is_closed(conn)) {
if (!done_printing && client->timer_started) {
struct timespec end;
clock_gettime(CLOCK_MONOTONIC, &end);
double time_taken = (end.tv_sec - client->start_time.tv_sec) + (end.tv_nsec - client->start_time.tv_nsec) / 1e9;
double mb = client->total_bytes / (1024.0 * 1024.0);
double throughput = mb / time_taken;
printf("\nTest Finished:\n");
printf("Total Data Received: %.2f MB\n", mb);
printf("Time Taken: %.2f seconds\n", time_taken);
printf("Total Throughput: %.2f MB/s\n", throughput);
done_printing = true;
}
printf("Connection closed.\n");
quiche_conn_free(conn);
free(client);
client = NULL;
break;

Binary file not shown.

Binary file not shown.