home *** CD-ROM | disk | FTP | other *** search
- -- This is a sample skeleton test
- -- It is based on the concept of having a control loop
- -- and a test loop. The test loop has everything the control loop has
- -- plus one feature to be measured.
- -- The time reported for the feature is based on many iterations.
- -- The measurement auto calibrates using the ITERATION package.
- -- The time calculation is a difference of a difference and thus
- -- removes measurement bias from many sources.
-
-
- -- PERFORMANCE MEASUREMENT : Comment here and at bottom on what measured
- -- more comments
- -- more comments
-
- with REMOTE_GLOBAL ; use REMOTE_GLOBAL ; -- control optimization
- with ITERATION ; -- obtain stable measurement
- with PIWG_IO ; -- output results
-
- procedure A000099 is -- main procedure to execute
-
- CPU_TIME : DURATION ; -- CPU time for one feature execution
- WALL_TIME : DURATION ; -- WALL time for one feature execution
- CHECK_TIMES : constant := 100 ; -- inside loop count and check
- ITERATION_COUNT : INTEGER ; -- set and varied by ITERATION package
- STABLE : BOOLEAN ; -- true when measurement stable
-
- --
- -- More declarations may go here
- --
-
- begin
-
- ITERATION.START_CONTROL ; -- dummy to bring in pages on some machines
-
- delay 0.5 ; -- wait for stable enviornment on some machines
-
- ITERATION.INITIALIZE ( ITERATION_COUNT ) ;
-
- loop -- until stable measurement, ITERATION_COUNT increases each time
-
- --
- -- Control loop
- --
- ITERATION.START_CONTROL ;
- for J in 1 .. ITERATION_COUNT loop
- GLOBAL := 0 ;
- for INSIDE_LOOP in 1 .. CHECK_TIMES loop
- GLOBAL := GLOBAL + A_ONE ; -- typical control loop is
- REMOTE ; -- these two statements
- end loop ;
- end loop ;
- ITERATION.STOP_CONTROL ( GLOBAL , CHECK_TIMES ) ;
-
- --
- -- Test loop
- --
- ITERATION.START_TEST ;
- for J in 1 .. ITERATION_COUNT loop
- GLOBAL := 0 ;
- for INSIDE_LOOP in 1 .. CHECK_TIMES loop
- -- PROC_0 ; -- this has control global increment and call inside
- -- example of testing a feature in the test loop
- null;
- end loop ;
- end loop ;
- ITERATION.STOP_TEST ( GLOBAL , CHECK_TIMES ) ;
- ITERATION.TEST_STABLE ( ITERATION_COUNT , STABLE ) ;
- exit when STABLE ;
- end loop ;
- --
- ITERATION.FEATURE_TIMES ( CPU_TIME , WALL_TIME ) ;
-
- --
- -- Printout
- --
- PIWG_IO.PIWG_OUTPUT ( "A000099" , "Procedure" ,
- CPU_TIME , WALL_TIME , ITERATION_COUNT ,
- " Three lines of comments explaining what was measured " ,
- " more comments " ,
- " more comments" ) ;
-
- end A000099 ;
-