Skip to content

Commit

Permalink
#74 show time
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 22, 2023
1 parent fc3736a commit a0ad934
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ export

# Run a single step from ./steps
define step
start=$$(date +%s%N)
echo -e "\n\n\n+++ $(1) +++\n"
@bash $(LOCAL)/steps/$(1).sh
end=$$(date +%s%N)
ms=$$(echo "($${end} - $${start}) / 1000000" | bc)
if [ "$${ms}" -gt "1000" ]; then
echo "Took $$(( ms / 1000 ))s"
else
echo "Took $${ms}ms"
fi
endef

# The main goal
Expand Down
4 changes: 2 additions & 2 deletions steps/measure-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ javam=$2
pos=$3
total=$4

start=$(echo "$(date +%N) / 1000000" | bc)
start=$(echo "$(date +%s%N) / 1000000" | bc)

mkdir -p "$(dirname "${javam}")"
metrics=$(find "${LOCAL}/metrics/" -type f -exec basename {} \;)
Expand All @@ -48,7 +48,7 @@ echo "${metrics}" | while read -r m; do
fi
done

end=$(echo "$(date +%N) / 1000000" | bc)
end=$(echo "$(date +%s%N) / 1000000" | bc)

echo "$(echo "${metrics}" | wc -w | xargs) scripts \
collected $(find "${javam}".* -type f | wc -l | xargs) metrics \
Expand Down

0 comments on commit a0ad934

Please sign in to comment.