Improve 2020/kurdyukov4/try.sh

The author stated that it gets progressively slower with less context so
it now uses time(1).
This commit is contained in:
Cody Boone Ferguson committed 2024-02-01 05:20:30 -08:00
1 parent 58fdcfdc2b
commit d00320a246
1 file changed
+18 -14
+18 -14
View File
@@ -15,35 +15,39 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: ./prog Shakespeare.txt 2000 10 1: "
read -r -n 1 -p "Press any key to run: time ./prog Shakespeare.txt 2000 10 1: "
echo 1>&2
./prog Shakespeare.txt 2000 10 1
time ./prog Shakespeare.txt 2000 10 1
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog Shakespeare.txt 2000 9 1: "
read -r -n 1 -p "Press any key to run: time ./prog Shakespeare.txt 2000 9 1: "
echo 1>&2
./prog Shakespeare.txt 2000 9 1
time ./prog Shakespeare.txt 2000 9 1
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog Shakespeare.txt 2000 8 1: "
read -r -n 1 -p "Press any key to run: time ./prog Shakespeare.txt 2000 8 1: "
echo 1>&2
./prog Shakespeare.txt 2000 8 1
time ./prog Shakespeare.txt 2000 8 1
read -r -n 1 -p "Press any key to run: ./prog Eugene_Onegin.txt 2000 10 1: "
read -r -n 1 -p "Press any key to run: time ./prog Eugene_Onegin.txt 2000 10 1: "
echo 1>&2
./prog Eugene_Onegin.txt 2000 10 1
time ./prog Eugene_Onegin.txt 2000 10 1
echo "$ echo "00000000000000000000 01 02 02 02 02 02 02" > test.txt" 1>&2
read -r -n 1 -p "Press any key to run: echo 00000000000000000000 01 02 02 02 02 02 02 > test.txt: "
echo 1>&2
echo "00000000000000000000 01 02 02 02 02 02 02" > test.txt
echo 1>&2
make rand >/dev/null || exit 0
read -r -n 1 -p "Press any key to run: ./prog test.txt 1000 2 123: "
read -r -n 1 -p "Press any key to run: time ./prog test.txt 1000 2 123: "
echo 1>&2
./prog test.txt 1000 2 123
time ./prog test.txt 1000 2 123
echo 1>&2
read -r -n 1 -p "Press any key to run: ./rand test.txt 1000 2 123" 1>&2
read -r -n 1 -p "Press any key to run: make rand >/dev/null: "
echo 1>&2
./rand test.txt 1000 2 123
make rand >/dev/null || exit 0
read -r -n 1 -p "Press any key to run: time ./rand test.txt 1000 2 123" 1>&2
echo 1>&2
time ./rand test.txt 1000 2 123
exit 0