home *** CD-ROM | disk | FTP | other *** search
- -- A000051
- --
- -- This is an executable procedure that can be called outside
- -- whatever is being measured.
- -- This version just prints present WALL time and CPU time.
- -- Other versions are avaliable that compute differences and save
- -- results on disk.
- --
- -- USAGE :
- -- A000051 (1)
- -- A000051 (2)
- -- A000051 (3)
- -- run being measured
- -- A000051 (4)
- --
- -- RESULT :
- -- ( (4) - (3) ) - ( (2) - (1) ) 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)
- --
-
- 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 A000051 is
- begin
- TEXT_IO.PUT ( " CPU time now=" ) ;
- DURATION_IO.PUT ( CPU_TIME_CLOCK ) ;
- TEXT_IO.PUT ( " WALL time now=" ) ;
- DURATION_IO.PUT ( CALENDAR.SECONDS(CALENDAR.CLOCK) ) ;
- TEXT_IO.PUT_LINE ( " seconds." ) ;
- end A000051 ;
-