#! /bin/sh -e LANG=C export LANG start=`callhours` echo $start start read t stop=`callhours` echo $stop stop diff=`echo "scale=2; $stop - $start" | bc -l` echo $diff diff # # NAME # stopwatch - record time # # SYNOPSIS # stopwatch # # DESCRIPTION # callhours records the time it was started. It keeps running untill a newline # is entered. It then prints the time, calculates and prints the # time it ran, and exits. All times are printed in hours since the epoch, # with two optional decimal digits. # # SEE ALSO # callhours # # VERSION # $Id: stopwatch,v 1.1 2003/02/12 15:56:01 joostvb Exp $ # # COPYRIGHT # This script is in the public domain # # AUTHOR # Joost van Baal #