File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -42,17 +42,31 @@ execute_tool () {
4242
4343OS=$( uname -s)
4444
45+ # Time the initial build
46+ start_time=$( date +%s%N)
4547call_make build
48+ initial_exit_code=$?
49+ end_time=$( date +%s%N)
50+ build_time=$(( (end_time - start_time) / 1000000000 ))
51+ build_time_frac=$(( (end_time - start_time) % 1000000000 / 1000000 ))
52+ printf " Time to compile \" ${TOOL_NAME} \" tool: %d.%03d seconds\n" $build_time $build_time_frac
4653
47- if [ $? -eq 0 ]; then
54+ if [ $initial_exit_code -eq 0 ]; then
4855 execute_tool " $@ "
4956else
5057 # It could have failed because of moved files, let's re-try after cleaning
5158 call_make clean
59+ # Time the clean and rebuild
60+ start_time=$( date +%s%N)
5261 call_make build
53- if [ $? -eq 0 ]; then
62+ rebuild_exit_code=$?
63+ end_time=$( date +%s%N)
64+ rebuild_time=$(( (end_time - start_time) / 1000000000 ))
65+ rebuild_time_frac=$(( (end_time - start_time) % 1000000000 / 1000000 ))
66+ printf " Time to re-compile \" ${TOOL_NAME} \" tool after clean: %d.%03d seconds\n" $rebuild_time $rebuild_time_frac
67+ if [ $rebuild_exit_code -eq 0 ]; then
5468 execute_tool " $@ "
5569 else
56- exit $?
70+ exit $rebuild_exit_code
5771 fi
5872fi
You can’t perform that action at this time.
0 commit comments