Skip to content

Instantly share code, notes, and snippets.

View neale's full-sized avatar
🧶
zen

Neale Ratzlaff neale

🧶
zen
View GitHub Profile
@neale
neale / Program timer
Last active August 29, 2015 14:19
Times programs in your directory and logs times to a file
#!/usr/bin/env bash
trap 'exit' ERR
set -u
DIR="$(pwd)"
LOG="$DIR/times/times.txt"
PROGRAMS=($(find $DIR -maxdepth 1 -type f | grep -v "$(basename $0)"))
mkdir -p $DIR/times
touch $LOG
echo "timing for each random array"
for i in "${PROGRAMS[@]}"; do