I'd use getopts, then the -n and -t options can arrive in any order:
while getopts :n:t: opt; do
case $opt in
n) num=$OPTARG;;
t) time=$OPTARG;;
:) echo "option -$OPTARG requires an argument"; exit;;
*) echo "invalid option: -$OPTARG"; exit;;
esac
done
shift $((OPTIND - 1))
for ((i=1; i<=$num; i++)); do
...
done