improved readability

This commit is contained in:
pvincent
2024-03-05 22:30:01 +04:00
parent 44f50c773b
commit c9fd0aca3e
8 changed files with 194 additions and 179 deletions
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
START=$(date +%s.%N)
eval -- "$*"
END=$(date +%s.%N)
DIFF=$(echo "scale=6; (${END} - ${START}) / 1" | bc)
printf -- "-----------------\nelapsed seconds = %f\n" "${DIFF}" >&2
+1 -1
View File
@@ -5,7 +5,7 @@ function usage() {
exit 1
}
function setCommand() {
function setCommand {
#arg1 input, #arg2 return value
declare -n ret=$2
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
echo >&2 "time elapsed in seconds..."
START=$(date +%s.%N)
# do something #######################
$@
#######################################
END=$(date +%s.%N)
DIFF=$(echo "scale=2; (${END} - ${START}) / 1" | bc)
echo "${DIFF}"