Skip to content

Commit

Permalink
refactor: simplify sleep time functions
Browse files Browse the repository at this point in the history
The `fn_sleep_time` function has been refactored to remove unnecessary conditions and set a default sleep time of 0.5 seconds. Additionally, four new functions (`fn_sleep_time_1`, `fn_sleep_time_5`, `fn_sleep_time_10`) have been added to provide different sleep times of 1, 5, and 10 seconds respectively. This improves code readability and allows for more flexibility in setting sleep times.
  • Loading branch information
dgibbs64 committed Oct 10, 2023
1 parent f5496c7 commit 7d46ea5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lgsm/modules/core_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ fn_ansi_loader() {
}

fn_sleep_time() {
if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then
if [ -z "${sleeptime}" ]; then
sleeptime=0.5
fi
sleep "${sleeptime}"
fi
sleep "0.1"
}

fn_sleep_time_1() {
sleep "1"
}

fn_sleep_time_5() {
sleep "5"
}

fn_sleep_time_10() {
sleep "10"
}

# Log display
Expand Down

0 comments on commit 7d46ea5

Please sign in to comment.