From 172b3805c3aae36e55c964a448aa9705b1110fc2 Mon Sep 17 00:00:00 2001 From: BodoBolero Date: Sat, 9 Nov 2024 17:36:57 +0100 Subject: [PATCH] fix convert_to_seconds double counting for milliseconds as minutes --- .github/workflows/benchmarking.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index 943c972fcb..729f88aef2 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -321,11 +321,6 @@ jobs: total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0} * 3600)) fi - # Check for minutes (m) - if [[ "$duration" =~ ([0-9]+)m ]]; then - total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0} * 60)) - fi - # Check for seconds (s) if [[ "$duration" =~ ([0-9]+)s ]]; then total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0})) @@ -334,6 +329,12 @@ jobs: # Check for milliseconds (ms) (if applicable) if [[ "$duration" =~ ([0-9]+)ms ]]; then total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0} / 1000)) + duration=${duration/${BASH_REMATCH[0]}/} # need to remove it to avoid double counting with m + fi + + # Check for minutes (m) - must be checked after ms because m is contained in ms + if [[ "$duration" =~ ([0-9]+)m ]]; then + total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0} * 60)) fi echo $total_seconds