home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 274.lha / ETime_v1.02 / etime.doc < prev    next >
Text File  |  1989-07-26  |  5KB  |  107 lines

  1.  
  2.        Program:  etime
  3.     Programmer:  George Kerber
  4.        Written:  07/16/89 - 07/23/89
  5.        Version:  1.02
  6.    Application:  AmigaDOS
  7.        Purpose:  This utility will provide an elapsed time display.
  8.                  The elapsed time will be displayed as hh:mm:ss or seconds. 
  9.  
  10.   Requirements:  AmigaDOS 1.3.
  11.          
  12.         SYNTAX:  etime [[-s] TIMERNAME [NOLINE]]
  13.  
  14.                           With no option, a help screen will be displayed.
  15.                      -s   The elapsed time will be returned in seconds.
  16.                  NOLINE   A newline will not be output after the elapsed 
  17.                           time is displayed.
  18.  
  19.   Installation:  Simply copy etime to your c: directory.  Or execute
  20.                  the install script called etime.install.
  21.  
  22.                            execute etime.install
  23.  
  24.                  The etime.install script provides an example of the one of
  25.                  the possible uses for etime.  Even if you don't use the
  26.                  etime.install script, take a look at it anyway.
  27.  
  28.     Directions:  Execute etime with a timername to start the timer. 
  29.                  Execute etime again with the same timername and the elapsed
  30.                  time will be displayed as hh:mm:ss.  If the -s option is 
  31.                  used the elapsed time will be displayed in total seconds
  32.                  only.  Any number of timers can be in use at any time.
  33.                  If the NOLINE option is used, a newline will not be
  34.                  performed after the elapsed time is displayed.  This option
  35.                  works the same as the NOLINE option for the AmigaDOS echo
  36.                  command
  37.       
  38. Considerations:  Etime uses the ENV: device, which isn't really a device at
  39.                  all.  It's just a directory in RAM:.  Etime creates an
  40.                  environmental variable in ENV: called etime.timername which
  41.                  contains the number of seconds that have occurred since
  42.                  January 1st, 1970.  If you change the system time, the
  43.                  elapsed time results will be inaccurate.  Since the start
  44.                  time is stored in RAM:, etimers will not survive
  45.                  a reboot.
  46.  
  47.                  You should be using AmigaDOS v1.3 and have the ENV directory
  48.                  already created in RAM: and have ENV: assigned.  I think
  49.                  etime will still work with v1.2, but the following lines
  50.                  must be added to your startup-sequence (these lines are
  51.                  already in the startup-sequence for v1.3):
  52.  
  53.                           makedir ram:env
  54.                           assign env: ram:env
  55.                 
  56.                  I suspect that Commodore will make a real handler for the
  57.                  ENV variables in AmigaDOS v1.4.  Depending on how they 
  58.                  implement this, etime may not work with AmigaDOS v1.4
  59.  
  60.       Examples:  So what good is it?
  61.  
  62.                  Try executing your programs using batch files, and start an
  63.                  etime timer as one of the first commands in the batch file.
  64.                  
  65.                  ....
  66.                  etime startprogram  ;start timer named startprogram
  67.                  ....
  68.                  ....
  69.                  execute your program.....
  70.                  ....
  71.                  echo "*n*n  Program Duration: " NOLINE
  72.                  etime startprogram  ;end timer and display the elapsed time
  73.                  ....
  74.  
  75.                  Now whenever you quit your program, the elapsed time will
  76.                  be displayed for the time you were using the program.
  77.  
  78.                  -----------------------------------------------------------
  79.  
  80.                  Use the -s option and the IF command to have certain
  81.                  commands performed only if enough time has passed.
  82.  
  83.                  ....
  84.                  etime timername1 ; start timer named timername1
  85.                  ....
  86.                  ....
  87.                  do stuff here
  88.                  ....
  89.                  etime > env:seconds -s timername1  ;end timer and place
  90.                                                     ;the elapsed seconds into
  91.                                                     ;an environmental variable
  92.                                                     ;called seconds
  93.                  if $seconds gt 60 VAL  ;compare elapsed seconds to 60
  94.                    echo "More than 60 seconds elapsed between start and finish"
  95.                    else
  96.                    echo "Less than 60 seconds elapsed between start and finish"
  97.                    endif
  98.                                  
  99.                  Get the idea.....
  100.  
  101.  
  102.         Status:  This is public domain, but please keep me as author and
  103.                  keep all the documentation intact.  Anyway, if something
  104.                  is wrong with this program, I'm not responsible.....
  105.  
  106.  
  107.