home *** CD-ROM | disk | FTP | other *** search
- -- A000053
- --
- -- 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 A000053 is
- MY_FILE : TEXT_IO.FILE_TYPE ;
- HOLD : STRING ( 1 .. 80 ) ;
- LENGTH : NATURAL ;
- CPU_SECONDS_NOW : DURATION := CPU_TIME_CLOCK ;
- WALL_SECONDS_NOW : DURATION := CALENDAR.SECONDS(CALENDAR.CLOCK) ;
-
- begin
- TEXT_IO.OPEN ( MY_FILE , TEXT_IO.IN_FILE , "A000052D" ) ;
- TEXT_IO.GET_LINE ( MY_FILE , HOLD , LENGTH ) ;
- TEXT_IO.CLOSE ( MY_FILE ) ;
- TEXT_IO.OPEN ( MY_FILE , TEXT_IO.OUT_FILE , "A000052D" ) ;
- TEXT_IO.PUT_LINE ( MY_FILE , HOLD ( 1 .. LENGTH ) ) ;
- TEXT_IO.PUT ( MY_FILE , " '53 CPU time =" ) ;
- DURATION_IO.PUT ( MY_FILE , CPU_SECONDS_NOW) ;
- TEXT_IO.PUT ( MY_FILE , " WALL time =" ) ;
- DURATION_IO.PUT ( MY_FILE , WALL_SECONDS_NOW ) ;
- TEXT_IO.PUT_LINE ( MY_FILE , " seconds." ) ;
- TEXT_IO.CLOSE ( MY_FILE ) ;
- end A000053 ;
-