#!/bin/sh # # timer.sh # Print out running time of hanoi algs. # # prime the system cache time hanoi 1 1>/dev/null 2>/dev/null # prime the i/o subsystem echo -e "Starting tests...\n" # do the test for DISKS in 0 8 16 20 22 24 26 28; do echo -e "Recursive for $DISKS disks:" time hanoi-r $DISKS 2>&1 echo -e echo -e "Iterative for $DISKS disks:" time hanoi-i $DISKS 2>&1 echo -e done