6 for ((i=0; i < times; i++)) ; do
7 echo "Starting iteration $i"
9 # to benchmark incremental compilation time, do a full build with the same compiler version first,
10 # and use the following clean command:
11 cargo clean -p lemmy_utils
15 RUSTC_WRAPPER='' cargo build -q
17 echo "Finished iteration $i after $(bc <<< "scale=0; $end - $start") seconds"
18 duration=$(bc <<< "$duration + $end - $start")
21 average=$(bc <<< "scale=0; $duration / $times")
23 echo "Average compilation time over $times runs is $average seconds"