Skip to content

Commit

Permalink
remove leagin 0s in convert_to_seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodobolero committed Nov 9, 2024
1 parent 8394ab2 commit 533908e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,22 +318,22 @@ jobs:
# Check for hours (h)
if [[ "$duration" =~ ([0-9]+)h ]]; then
total_seconds=$((total_seconds + BASH_REMATCH[1] * 3600))
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] * 60))
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]))
total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0}))
fi

# Check for milliseconds (ms) (if applicable)
if [[ "$duration" =~ ([0-9]+)ms ]]; then
total_seconds=$((total_seconds + BASH_REMATCH[1] / 1000))
total_seconds=$((total_seconds + ${BASH_REMATCH[1]#0} / 1000))
fi

echo $total_seconds
Expand Down

0 comments on commit 533908e

Please sign in to comment.