#! /bin/bash
n=$1
min=$2
# print slowest $n step times, more than $min seconds
shift
shift
"$@" >COQC.log || exit 1
echo "--- stdout ---"
<COQC.log grep -v '^Chars '
echo "--- slowest $n commands taking at least $min seconds ---"
<COQC.log grep '^Chars ' |sort --key=6gr |head -"$n" |awk "\$6 >= $min"
rm COQC.log
