time-and-save.sh 441 B

12345678910111213
  1. #!/bin/bash
  2. # Save path the current path that will be used to store the results.
  3. BASE_PATH=$(pwd)
  4. # Local variable to store if cpu or gpu directed benchmark
  5. TYPE=$3
  6. # Enter in the directory passed as first parameter, then execute run and save the results in the file passed as second parameter
  7. cd $1
  8. BENCH_NAME=$1
  9. BENCH_TIME=`(/usr/bin/time -f "%e" ./run-$TYPE) 2>&1 > /dev/zero | tail -1`
  10. echo "$BENCH_NAME $BENCH_TIME" >> $BASE_PATH/$2