home *** CD-ROM | disk | FTP | other *** search
- -- A000054
- --
- -- This is an executable procedure that can be called outside
- -- whatever is being measured.
- -- This version works in conjunction with A000052,A000054,A000055
- -- to measure CPU time and WALL time without modifying the tests
- -- There will be a file named A000052D created and used by these
- -- procedures.
- --
- -- USAGE :
- -- A000052
- -- optional control
- -- A000053
- -- A000054
- -- test being measured
- -- A000055
- --
- -- RESULT :
- -- ( (55) - (54) ) - ( (53) - (52) ) is the measurement
- --
- -- The second expression takes out the time to make the
- -- measurement. As a check, (3) - (2) should be close to (2) - (1)
- --
- -- The printout gives the CPU and WALL time in seconds for
- -- the run being measured.
- --
-
- with CPU_TIME_CLOCK ; -- various choices on tape
- with CALENDAR ; -- used for WALL clock times
- with TEXT_IO ; -- for printing times
- with DURATION_IO ; -- for printing times
-
- procedure A000054 is
- MY_FILE : TEXT_IO.FILE_TYPE ;
- HOLD_1 : STRING ( 1 .. 80 ) ;
- HOLD_2 : STRING ( 1 .. 80 ) ;
- LENGTH : NATURAL ;
- begin
- TEXT_IO.OPEN ( MY_FILE , TEXT_IO.IN_FILE , "A000052D" ) ;
- TEXT_IO.GET_LINE ( MY_FILE , HOLD_1 , LENGTH ) ;
- TEXT_IO.GET_LINE ( MY_FILE , HOLD_2 , LENGTH ) ;
- TEXT_IO.CLOSE ( MY_FILE ) ;
- TEXT_IO.OPEN ( MY_FILE , TEXT_IO.OUT_FILE , "A000052D" ) ;
- TEXT_IO.PUT_LINE ( MY_FILE , HOLD_1 ( 1 .. LENGTH ) ) ;
- TEXT_IO.PUT_LINE ( MY_FILE , HOLD_2 ( 1 .. LENGTH ) ) ;
- TEXT_IO.PUT ( MY_FILE , " '54 CPU time =" ) ;
- DURATION_IO.PUT ( MY_FILE , CPU_TIME_CLOCK ) ;
- TEXT_IO.PUT ( MY_FILE , " WALL time =" ) ;
- DURATION_IO.PUT ( MY_FILE , CALENDAR.SECONDS(CALENDAR.CLOCK) ) ;
- TEXT_IO.PUT_LINE ( MY_FILE , " seconds." ) ;
- TEXT_IO.CLOSE ( MY_FILE ) ;
- end A000054 ;
-