Skip to content

Commit adf710d

Browse files
committed
add execution time
add elapsed time of the script in seconds
1 parent aa66cfc commit adf710d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ start_lint() {
6969
SUCCESS_COUNTER=0
7070
ERROR_COUNTER=0
7171

72+
START_TIME=$(date +%s)
73+
7274
for file in $(find ${PATH_TO_SCAN} -type f -name "*.php"${IGNOREPATHS}); do
7375
RESULTS=$(php -l ${file})
7476

@@ -82,7 +84,9 @@ start_lint() {
8284
fi
8385
done
8486

85-
printf "\ncheck has finished\n"
87+
END_TIME=$(date +%s)
88+
89+
printf "\ncheck has finished in $((END_TIME-START_TIME))s\n"
8690
printf " - ${YELLOW}${FILE_COUNTER}${NC} files checked\n"
8791
printf " - ${GREEN}${SUCCESS_COUNTER}${NC} files without error\n"
8892
printf " - ${RED}${ERROR_COUNTER}${NC} files with error\n"

0 commit comments

Comments
 (0)