tcp/quic lab patched again
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -117,7 +117,21 @@ int main(int argc, char *argv[]) {
|
|||||||
quiche_conn *conn = client->conn;
|
quiche_conn *conn = client->conn;
|
||||||
|
|
||||||
if (quiche_conn_is_closed(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");
|
printf("Connection closed.\n");
|
||||||
|
quiche_conn_free(conn);
|
||||||
free(client);
|
free(client);
|
||||||
client = NULL;
|
client = NULL;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user