Allow 7-zip benchmark to run multiple times

This commit is contained in:
ThomasKaiser 2018-07-22 14:53:10 +02:00
parent b293f186fb
commit e63138bacd

View file

@ -239,6 +239,7 @@ ParseOptions() {
;;
z)
# Do a quick 7-zip benchmark to estimate CPU performance
runs=$2
Run7ZipBenchmark 2>/dev/null
exit 0
;;
@ -1112,9 +1113,13 @@ Run7ZipBenchmark() {
trap "rm \"${MonitoringOutput}\" ; exit 0" 0 1 2 3 15
armbianmonitor -m >${MonitoringOutput} &
MonitoringPID=$!
# run 7-zip benchmark after waiting 10 seconds to spot whether the system was idle before
# run 7-zip benchmarks after waiting 10 seconds to spot whether the system was idle before.
# We run the benchmark a single time by default unless otherwise specified on the command line
RunHowManyTimes=${runs:-1}
sleep 10
for ((i=1;i<=RunHowManyTimes;i++)); do
"${MyTool}" b
done
# report CLI monitoring results as well
kill ${MonitoringPID}
echo -e "\nMonitoring output recorded while running the benchmark:\n"