From 0818da035118d40a69c286ec1c7908582dc60747 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Wed, 23 Apr 2025 12:41:21 -0500 Subject: [PATCH] Refactor get_tx_failed function to remove unnecessary logging and improve performance --- runtest.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtest.sh b/runtest.sh index 1443bb8..cace8c7 100755 --- a/runtest.sh +++ b/runtest.sh @@ -36,10 +36,7 @@ sleep $LEAD_TIME # Function to get current TX failed count get_tx_failed() { - echo "Getting TX failed count..." - SECONDS=0 iw dev $INTERFACE station dump | awk '/tx failed/ {print $3}' - echo "This took $SECONDS seconds." } freq_to_channel() { @@ -162,9 +159,12 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do continue fi + SECONDS=0 + echo " Gathering TX failed count..." FAILED_NOW=$(get_tx_failed) FAILED_DELTA=$((FAILED_NOW - FAILED_START)) FAILED_START=$FAILED_NOW + echo " This took $SECONDS seconds." freq=$(iw dev "$INTERFACE" link | awk '/freq:/ {print $2}') channel=$(freq_to_channel "$freq")