You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.3 KiB
Plaintext
69 lines
1.3 KiB
Plaintext
..-
|
|
help for ^elapse^
|
|
..-
|
|
|
|
Timing portions of a program
|
|
- ----------------------------
|
|
|
|
^elapse^ start_time [name_of_operation]
|
|
|
|
|
|
Where start_time is a previously defined macro equal to
|
|
the global system macro S_TIME at some earlier point, and
|
|
name_of_operation is a string.
|
|
|
|
|
|
Description
|
|
- -----------
|
|
|
|
^Elapse^ displays a string with the name of the operation,
|
|
if specified, and the time elapsed between start_time and
|
|
current time.
|
|
|
|
|
|
|
|
Options
|
|
- -------
|
|
|
|
name_of_operation is a user-defined string.
|
|
|
|
|
|
Remarks
|
|
- -------
|
|
|
|
^Elapse^ automates the procedure of timing a piece of code
|
|
or an entire program. It is accurate over midnight, but not
|
|
over several days. It also creates a global S_elap, which is
|
|
a numerical macro of the form hhmmss, where hh is the number
|
|
of hours, mm the number of minutes, and ss the number of seconds.
|
|
|
|
|
|
Examples
|
|
- --------
|
|
|
|
^local st = "$S_TIME"^
|
|
^...^
|
|
^local oper "Maximum likelihood estimation"^
|
|
^elapse "`st'" "`oper'"^
|
|
- Maximum likelihood estimation took 7 minutes, 15 seconds.
|
|
|
|
^elapse `st'^
|
|
- Elapsed time was 1 hour, 10 minutes, 32 seconds.
|
|
|
|
^quietly elapse `st'^
|
|
^if $S_elap > 4500 { mat xx = startxx }^
|
|
|
|
|
|
Saved Results
|
|
- -------------
|
|
|
|
S_elap (see above).
|
|
|
|
|
|
Author
|
|
- ------
|
|
|
|
Frederic Zimmerman
|
|
Food Research Institute
|
|
Stanford University
|