From cc397252cc2c189664b13e9e335cfe94a91d3508 Mon Sep 17 00:00:00 2001 From: b4rtaz Date: Sun, 13 Oct 2024 23:09:21 +0200 Subject: [PATCH] socket-test. --- src/socket-test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket-test.cpp b/src/socket-test.cpp index 68b8ecd..9e7407e 100644 --- a/src/socket-test.cpp +++ b/src/socket-test.cpp @@ -34,7 +34,7 @@ void server() { totalTime += duration_cast(t2 - t0).count(); } - double nPingPongs = 1000000.0 / (totalTime / (double)nAttempts); + double nPingPongs = (1.0 / (totalTime / 1000000.0)) * (double)nAttempts; printf("[%6d bytes] write: %5lld us, read: %5lld us, total: %5lld us, nPingPongs: %.2f\n", currentPackageSize, totalWriteTime, totalReadTime, totalTime, nPingPongs); }