home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / timeit.seq < prev    next >
Text File  |  1991-03-14  |  1KB  |  40 lines

  1. \\ TIMEIT.SEQ     A DOS command performance measurer      by Tom Zimmer
  2.  
  3.   This simple little program can be used to measure the amount of time
  4. it takes for various DOS operations or commands to execute. Use TIMEIT
  5. as follows:
  6.  
  7.                 C:>TIMEIT <DOS_command_line> <enter>
  8.  
  9.   You can time programs, batch files, or anything that executes and
  10. returns to DOS. The execution time is measured in Hours, Minutes,
  11. Seconds, and hundreths. The program load time is also included.
  12.  
  13.   TIMEIT compiles to around 3.5k, and uses only about 4k of your DOS
  14. program memory, so its no memory hog.
  15.  
  16.   Compile TIMEIT with the following command line:
  17.  
  18.                 TCOM TIMEIT /OPT /NOINIT <enter>
  19.  
  20. {
  21.  
  22. : main          ( -- )
  23.                 DECIMAL                         \ always select decimal
  24.                 CAPS ON                         \ ignore cAsE
  25.                 ?DS: SSEG !                     \ init search segment
  26.                 DOSIO_INIT                      \ init EMIT, TYPE & SPACES
  27.                 PAD 100 + SET_MEMORY            \ minimize memory usage
  28.                 DOS_TO_TIB                      \ move command tail to TIB
  29.                 COMSPEC_INIT                    \ init command specification
  30.                 .time
  31.                 time-reset
  32.                 0 word  dup c@
  33.                 if      $sys drop
  34.                 else    drop
  35.                 then
  36.                 cr .time
  37.                 .elapsed ;
  38.  
  39. }
  40.