home *** CD-ROM | disk | FTP | other *** search
-
- Program: etime
- Programmer: George Kerber
- Written: 07/16/89 - 07/23/89
- Version: 1.02
- Application: AmigaDOS
- Purpose: This utility will provide an elapsed time display.
- The elapsed time will be displayed as hh:mm:ss or seconds.
-
- Requirements: AmigaDOS 1.3.
-
- SYNTAX: etime [[-s] TIMERNAME [NOLINE]]
-
- With no option, a help screen will be displayed.
- -s The elapsed time will be returned in seconds.
- NOLINE A newline will not be output after the elapsed
- time is displayed.
-
- Installation: Simply copy etime to your c: directory. Or execute
- the install script called etime.install.
-
- execute etime.install
-
- The etime.install script provides an example of the one of
- the possible uses for etime. Even if you don't use the
- etime.install script, take a look at it anyway.
-
- Directions: Execute etime with a timername to start the timer.
- Execute etime again with the same timername and the elapsed
- time will be displayed as hh:mm:ss. If the -s option is
- used the elapsed time will be displayed in total seconds
- only. Any number of timers can be in use at any time.
- If the NOLINE option is used, a newline will not be
- performed after the elapsed time is displayed. This option
- works the same as the NOLINE option for the AmigaDOS echo
- command
-
- Considerations: Etime uses the ENV: device, which isn't really a device at
- all. It's just a directory in RAM:. Etime creates an
- environmental variable in ENV: called etime.timername which
- contains the number of seconds that have occurred since
- January 1st, 1970. If you change the system time, the
- elapsed time results will be inaccurate. Since the start
- time is stored in RAM:, etimers will not survive
- a reboot.
-
- You should be using AmigaDOS v1.3 and have the ENV directory
- already created in RAM: and have ENV: assigned. I think
- etime will still work with v1.2, but the following lines
- must be added to your startup-sequence (these lines are
- already in the startup-sequence for v1.3):
-
- makedir ram:env
- assign env: ram:env
-
- I suspect that Commodore will make a real handler for the
- ENV variables in AmigaDOS v1.4. Depending on how they
- implement this, etime may not work with AmigaDOS v1.4
-
- Examples: So what good is it?
-
- Try executing your programs using batch files, and start an
- etime timer as one of the first commands in the batch file.
-
- ....
- etime startprogram ;start timer named startprogram
- ....
- ....
- execute your program.....
- ....
- echo "*n*n Program Duration: " NOLINE
- etime startprogram ;end timer and display the elapsed time
- ....
-
- Now whenever you quit your program, the elapsed time will
- be displayed for the time you were using the program.
-
- -----------------------------------------------------------
-
- Use the -s option and the IF command to have certain
- commands performed only if enough time has passed.
-
- ....
- etime timername1 ; start timer named timername1
- ....
- ....
- do stuff here
- ....
- etime > env:seconds -s timername1 ;end timer and place
- ;the elapsed seconds into
- ;an environmental variable
- ;called seconds
- if $seconds gt 60 VAL ;compare elapsed seconds to 60
- echo "More than 60 seconds elapsed between start and finish"
- else
- echo "Less than 60 seconds elapsed between start and finish"
- endif
-
- Get the idea.....
-
-
- Status: This is public domain, but please keep me as author and
- keep all the documentation intact. Anyway, if something
- is wrong with this program, I'm not responsible.....
-
-
-