/*
   Program:            CaseVsIf

   Author:             Dan G. Applewhite

   Written:            February 28, 1994

   Purpose:            To test the claim by Boris Borzic (in the
                       March 1994 issue of Reference Clipper)
                       that DO CASE...ENDCASE is faster than
                       IF...ELSE...ENDIF.

                       Phase 1 compares the total time required to
                       reach the same condition in both structures
                       and then exit the structure.  (I state it
                       this way because Phase 1 cannot recognize
                       whether the difference in times for the
                       two structures is the "seek" time or the
                       "exit" time or a combination of both.)

                       Phase 2 compares the point-to-point times
                       for the two structures; that is, how much
                       time elapses from evaluating one condition
                       to evaluating the next condition.

                       Phase 3 compares the "seek" times of both
                       structures and the "exit" times of both
                       structures; that is, how long it takes to
                       stop at the .T. condition and how long
                       it takes to then exit from the structure.
                       It also compares the total of the "seek"
                       and "exit" times (which need not necessarily
                       correspond to the Phase 1 time because the
                       Phase 1 test involves only conditions,
                       whereas the Phase 3 test involves those
                       same conditions _plus_ actions).

   Compiler Used:      Clipper 5.2c        // switches /n /es2 /w

   Linker Used:        .RTLink 3.14B

   This program is an orginal work by Dan G. Applewhite and is
   hereby placed into the public domain.
*/

#include "inkey.ch"

#define CRLF          ( Chr( 13 ) + Chr( 10 ) )

#define MAX_ITERS     1000

#define MIN_SECONDS   0.10

#define BUMP_UP_RATE  1.67

// Changing COND_COUNT would require also changing several
// DO CASE...ENDCASE and IF...ELSE...ENDIF structures
// throughout the program plus the #defines below.

#define COND_COUNT    25

// Adjust the following #defines to determine the type of
// conditions to be evaluated.  Different conditions may
// give surprisingly differents timing results!

// #define USING_NUMBERS

#ifdef USING_NUMBERS

// #define NEXPR + 64
   #define NEXPR

   #define C1     1 NEXPR
   #define C2     2 NEXPR
   #define C3     3 NEXPR
   #define C4     4 NEXPR
   #define C5     5 NEXPR
   #define C6     6 NEXPR
   #define C7     7 NEXPR
   #define C8     8 NEXPR
   #define C9     9 NEXPR
   #define C10   10 NEXPR
   #define C11   11 NEXPR
   #define C12   12 NEXPR
   #define C13   13 NEXPR
   #define C14   14 NEXPR
   #define C15   15 NEXPR
   #define C16   16 NEXPR
   #define C17   17 NEXPR
   #define C18   18 NEXPR
   #define C19   19 NEXPR
   #define C20   20 NEXPR
   #define C21   21 NEXPR
   #define C22   22 NEXPR
   #define C23   23 NEXPR
   #define C24   24 NEXPR
   #define XCOND nCond NEXPR

#else

// #define NEXPR + 64
   #define NEXPR
// #define CEXPR + " extra characters "
   #define CEXPR

   #define C1    Chr(  1 NEXPR ) CEXPR
   #define C2    Chr(  2 NEXPR ) CEXPR
   #define C3    Chr(  3 NEXPR ) CEXPR
   #define C4    Chr(  4 NEXPR ) CEXPR
   #define C5    Chr(  5 NEXPR ) CEXPR
   #define C6    Chr(  6 NEXPR ) CEXPR
   #define C7    Chr(  7 NEXPR ) CEXPR
   #define C8    Chr(  8 NEXPR ) CEXPR
   #define C9    Chr(  9 NEXPR ) CEXPR
   #define C10   Chr( 10 NEXPR ) CEXPR
   #define C11   Chr( 11 NEXPR ) CEXPR
   #define C12   Chr( 12 NEXPR ) CEXPR
   #define C13   Chr( 13 NEXPR ) CEXPR
   #define C14   Chr( 14 NEXPR ) CEXPR
   #define C15   Chr( 15 NEXPR ) CEXPR
   #define C16   Chr( 16 NEXPR ) CEXPR
   #define C17   Chr( 17 NEXPR ) CEXPR
   #define C18   Chr( 18 NEXPR ) CEXPR
   #define C19   Chr( 19 NEXPR ) CEXPR
   #define C20   Chr( 20 NEXPR ) CEXPR
   #define C21   Chr( 21 NEXPR ) CEXPR
   #define C22   Chr( 22 NEXPR ) CEXPR
   #define C23   Chr( 23 NEXPR ) CEXPR
   #define C24   Chr( 24 NEXPR ) CEXPR

   // Important: Do not begin XCOND with "(" because doing
   // so would cause a compile error on the IF structures.

   #define XCOND Chr( nCond NEXPR ) CEXPR

#endif

#xtranslate STRINGIFY( <exp> ) => #<exp>

/*
   CaseVsIf() calls other routines which do the actual comparisons.
   (It stands for "CASE versus IF".)
*/
FUNCTION CaseVsIf( cMaxIters, cMinSecs )

   LOCAL nMaxIters := ;
      If( cMaxIters == NIL, MAX_ITERS, Val( cMaxIters ) )
   LOCAL nMinSecs := ;
      If( cMinSecs == NIL, MIN_SECONDS, ;
      Val( Str( Val( cMinSecs ), 5, 2 ) ) )
   LOCAL nMax1 := 0, nMax2 := 0, nMax3 := 0, lGoodTest := .F.

   SET SCOREBOARD OFF

   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( "CaseVsIf: A Utility for Comparing execution times" )
   OutStd( CRLF )
   OutStd( "of the multi-branch decision structures:" )
   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( "DO CASE...ENDCASE versus IF...ELSE...ENDIF" )
   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( "For phases 1 and 3, " )
   OutStd( "conditions are " )

#ifdef USING_NUMBERS
   OutStd( "numeric" )
#else
   OutStd( "character" )
#endif

   OutStd( " comparisons, such as:" )
   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( Space( 3 ), STRINGIFY( XCOND ), "== ;" )
   OutStd( CRLF )
   OutStd( Space( 3 ), STRINGIFY( C1 ) )

   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( "Starting nMaxIters value:", nMaxIters )
   OutStd( CRLF )
   OutStd( "Minimum number of seconds for all results:", nMinSecs )

   OutStd( CRLF )

   // Repeat the test until all three phases are using the
   // same number of iterations while also meeting the
   // minimum-seconds requirement.

   WHILE !lGoodTest ;
   .AND. !( InKey() == K_ESC .AND. LastKey() == K_ESC )

      //  Compare condition "seek" + "exit" total time
      nMax1 := Phase1( nMaxIters, nMinSecs )
      nMaxIters := Max( nMax1, nMaxIters )

      //  Compare condition "stepping" time during "seek"
      nMax2 := Phase2( nMaxIters, nMinSecs )
      nMaxIters := Max( nMax1, nMaxIters )

      //  Compare condition "seek" and "exit" times separately
      //  and also compare the sum of "seek" and "exit" times
      nMax3 := Phase3( nMaxIters, nMinSecs ) 

      // Or should I have used DO CASE...ENDCASE for this? <g>

      IF nMax1 == nMax2 .AND. nMax1 == nMax3
         lGoodTest := .T.
         OutStd( CRLF )
         OutStd( CRLF )
      ELSE
         nMaxIters := Int( Max( nMax1, Max( nMax2, nMax3 ) ) ;
            * BUMP_UP_RATE * BUMP_UP_RATE )
         OutStd( CRLF )
         OutStd( CRLF )
         OutStd( "The test just completed used a different" )
         OutStd( CRLF )
         OutStd( "number of iterations for the three phases." )
         OutStd( CRLF )
         OutStd( "The test is being repeated using a higher" )
         OutStd( CRLF )
         OutStd( "number of iterations." )
         OutStd( CRLF )
      ENDIF

   END

   OutStd( CRLF )
   OutStd( CRLF )

   IF lGoodTest
      OutStd( "-+-+-+ End of Test +-+-+-" )
   ELSE
      OutStd( "*** Test was interrupted ***" )
   ENDIF

   OutStd( CRLF )

   RETURN ( NIL )

///////////////////////////////////////////////////////////////////

/*
   Phase1() compares the times required by CASE and IF structures
   to locate the first .T. condition and then exit the structure.
*/
STATIC FUNCTION Phase1( nMaxIters, nMinSecs )

   LOCAL nIters, cCond, nCond, nStart, nCase, nIf
   LOCAL nExceedsBy
   LOCAL lTooFast := .T.

   OutStd( CRLF )
   OutStd( "Testing Phase  1 : Find .T. condition then exit structure" )
   OutStd( CRLF )

   WHILE lTooFast

      BEGIN SEQUENCE

         OutStd( CRLF )
         OutStd( "Number of iterations:", nMaxIters )
         OutStd( CRLF )
      
         FOR nCond :=  1 TO COND_COUNT

            nStart := Seconds()

            FOR nIters :=  1 TO nMaxIters
               DO CASE
               CASE XCOND == C1
               CASE XCOND == C2
               CASE XCOND == C3
               CASE XCOND == C4
               CASE XCOND == C5
               CASE XCOND == C6
               CASE XCOND == C7
               CASE XCOND == C8
               CASE XCOND == C9
               CASE XCOND == C10
               CASE XCOND == C11
               CASE XCOND == C12
               CASE XCOND == C13
               CASE XCOND == C14
               CASE XCOND == C15
               CASE XCOND == C16
               CASE XCOND == C17
               CASE XCOND == C18
               CASE XCOND == C19
               CASE XCOND == C20
               CASE XCOND == C21
               CASE XCOND == C22
               CASE XCOND == C23
               CASE XCOND == C24
               OTHERWISE
               ENDCASE
            NEXT nIters

            nCase := Seconds() - nStart
   
            IF nCase < nMinSecs
               nMaxIters := TooFast( nMaxIters )
               BREAK
            ENDIF 
      
            nStart := Seconds()

            FOR nIters :=  1 TO nMaxIters
               IF     XCOND == C1
               ELSEIF XCOND == C2
               ELSEIF XCOND == C3
               ELSEIF XCOND == C4
               ELSEIF XCOND == C5
               ELSEIF XCOND == C6
               ELSEIF XCOND == C7
               ELSEIF XCOND == C8
               ELSEIF XCOND == C9
               ELSEIF XCOND == C10
               ELSEIF XCOND == C11
               ELSEIF XCOND == C12
               ELSEIF XCOND == C13
               ELSEIF XCOND == C14
               ELSEIF XCOND == C15
               ELSEIF XCOND == C16
               ELSEIF XCOND == C17
               ELSEIF XCOND == C18
               ELSEIF XCOND == C19
               ELSEIF XCOND == C20
               ELSEIF XCOND == C21
               ELSEIF XCOND == C22
               ELSEIF XCOND == C23
               ELSEIF XCOND == C24
               ELSE
               ENDIF
            NEXT nIters

            nIf := Seconds() - nStart
   
            IF nIf < nMinSecs
               nMaxIters := TooFast( nMaxIters )
               BREAK
            ENDIF 

            ShowResult( nCond, nCase, nIf )

         NEXT nCond
   
         lTooFast := .F.
   
      END SEQUENCE
   
   END

   OutStd( CRLF )

   RETURN ( nMaxIters )

///////////////////////////////////////////////////////////////////

/*
   Phase2() compares the times required by CASE and IF structures
   to move from testing one condition to testing the next one.
*/
STATIC FUNCTION Phase2( nMaxIters, nMinSecs )

   LOCAL aPtToPt := Array( COND_COUNT, 2 )
   LOCAL nStru, nCond, nIters, nLowSecs, nCase, nIf
   LOCAL lTooFast := .T., nExceedsBy

   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( "Testing Phase 2 : Stepping time between conditions" )
   OutStd( CRLF )

   FOR nCond :=  1 TO COND_COUNT
      aPtToPt[ nCond, 1 ] := 0
      aPtToPt[ nCond, 2 ] := 0
   NEXT nCond

   WHILE lTooFast

      BEGIN SEQUENCE

      OutStd( CRLF )
      OutStd( "Number of iterations:", nMaxIters )
      OutStd( CRLF )

      OutStd( CRLF )
      OutStd( "Timing DO CASE...ENDCASE . . ." )
      OutStd( CRLF )
   
      Elapsed( .T. )
   
      FOR nIters :=  1 TO nMaxIters
   
         nStru :=  1
         nCond :=  1
      
         DO CASE
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         CASE ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         OTHERWISE
            ( ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++ )
         ENDCASE
   
      NEXT nIters

      OutStd( "(finished timing DO CASE...ENDCASE)" )
      OutStd( CRLF )
   
      OutStd( CRLF )
      OutStd( "Timing IF...ELSE...ENDIF . . ." )
      OutStd( CRLF )
   
      Elapsed( .T. )
   
      FOR nIters :=  1 TO nMaxIters
      
         nStru := 2
         nCond :=  1
      
         IF     ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSEIF ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++
         ELSE
            ( ( aPtToPt[ nCond, nStru ] += Elapsed(), -1 ) == nCond++ )
         ENDIF
   
      NEXT nIters

      OutStd( CRLF )
      OutStd( "(finished timing IF...ELSE...ENDIF)" )   
      OutStd( CRLF )

      nCond :=  1
   
      OutStd( CRLF )
      OutStd( "Results of Phase 2 'stepping' time comparisons:" )
      OutStd( CRLF )

      nLowSecs := nMinSecs
   
      AEval( aPtToPt, { | a_ | ;
            nCond++, ;
            nCase := a_[  1 ], ;
            nIf := a_[ 2 ], ;
            nLowSecs := Min( nLowSecs, Min( nCase, nIf ) ), ;
            ShowResult( nCond, nCase, nIf ) ;
            } )
      
      IF nLowSecs < nMinSecs
         nMaxIters := TooFast( nMaxIters )
         BREAK
      ENDIF
   
      lTooFast := .F.

      END SEQUENCE

   END

   OutStd( CRLF )
         
   RETURN ( nMaxIters )

///////////////////////////////////////////////////////////////////

/*
   Phase3() compares the times required by CASE and IF structures
   to locate the first .T. condition and also the times required
   to exit from the structure after locating the .T. condition.
*/
STATIC FUNCTION Phase3( nMaxIters, nMinSecs )

   LOCAL nIters, cCond, nCond
   LOCAL nStart, nCaseEntr, nCaseExit, nCase
   LOCAL nIfEntr, nIfExit, nIf
   LOCAL nExceedsBy
   LOCAL lTooFast := .T.

   OutStd( CRLF )
   OutStd( "Testing Phase 3 : 'seek' and 'exit' times" )
   OutStd( CRLF )

   WHILE lTooFast

      BEGIN SEQUENCE

         OutStd( CRLF )
         OutStd( "Number of iterations:", nMaxIters )
         OutStd( CRLF )
      
         FOR nCond :=  1 TO COND_COUNT

            nCaseEntr := 0
            nCaseExit := 0

            nStart := Seconds()

            FOR nIters :=  1 TO nMaxIters

               DO CASE
               CASE XCOND == C1
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C2
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C3
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C4
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C5
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C6
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C7
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C8
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C9
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C10
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C11
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C12
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C13
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C14
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C15
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C16
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C17
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C18
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C19
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C20
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C21
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C22
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C23
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               CASE XCOND == C24
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               OTHERWISE
                  nCaseEntr += Seconds() - nStart
                  nStart := Seconds()
               ENDCASE

               nCaseExit += Seconds() - nStart

            NEXT nIters

            nCase := nCaseExit + nCaseEntr
   
            IF nCase < nMinSecs
               nMaxIters := TooFast( nMaxIters )
               BREAK
            ENDIF 

            nIfEntr := 0
            nIfExit := 0
      
            nStart := Seconds()

            FOR nIters :=  1 TO nMaxIters

               IF     XCOND == C1
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C2
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C3
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C4
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C5
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C6
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C7
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C8
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C9
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C10
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C11
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C12
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C13
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C14
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C15
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C16
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C17
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C18
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C19
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C20
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C21
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C22
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C23
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSEIF XCOND == C24
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ELSE
                  nIfEntr += Seconds() - nStart
                  nStart := Seconds()
               ENDIF

               nIfExit += Seconds() - nStart

            NEXT nIters

            nIf := nIfExit + nIfEntr

            OutStd( CRLF )

            ShowResult( nCond, nCaseEntr, nIfEntr, "(Seek)" )
            ShowResult( nCond, nCaseExit, nIfExit, "(Exit)" )
            ShowResult( nCond, nCase, nIf, "(Total)" )

         NEXT nCond
   
         lTooFast := .F.
   
      END SEQUENCE
   
   END

   OutStd( CRLF )

   RETURN ( nMaxIters )

///////////////////////////////////////////////////////////////////
   
/*
   TooFast() is called by Phase1(), Phase2(), and Phase3().
*/
STATIC FUNCTION TooFast( nMaxIters )

   OutStd( CRLF )
   OutStd( CRLF )
   OutStd( LTrim( Str( nMaxIters, 6, 0 ) ), ;
      "iterations are too fast", ;
      "to provide the minimum seconds count;" )
   OutStd( CRLF )
   OutStd( "bumping up to", ;
      Str( nMaxIters := Int( nMaxIters * BUMP_UP_RATE ), 6, 0 ) )
   OutStd( CRLF )

   RETURN ( Int( nMaxIters ) )

///////////////////////////////////////////////////////////////////

/*
   Elapsed() returns the time, in seconds, that has passed since
   the prior call to Elapsed.  It is called from Phase2().
*/
STATIC FUNCTION Elapsed( lReset )

   STATIC nLastSecs := 0

   LOCAL nElapsed

   IF VALTYPE( lReset ) == "L" .AND. lReset == .T.
      nLastSecs := Seconds()
   ENDIF

   nElapsed := Seconds() - nLastSecs

   nLastSecs := Seconds()

   RETURN ( nElapsed )

///////////////////////////////////////////////////////////////////

/*
   ShowResult() is called from Phase1(), Phase2(), and Phase3().
*/
STATIC FUNCTION ShowResult( nCond, nCase, nIf, cLabel )

   LOCAL nExceedsBy

   IF cLabel == NIL
      cLabel := "Cond. #"
   ENDIF

   cLabel := Left( RTrim( cLabel) + ":" + Space( 7 ), 7 )
 
   IF Min( nCase, nIf ) <= 0
      nExceedsBy := 0
   ELSE
      nExceedsBy := ( ( Max( nCase, nIf ) ;
         / Min( nCase, nIf ) ) -  1 ) *  100
   ENDIF
    
   OutStd( CRLF )
   OutStd( cLabel, Str( nCond, 3, 0 ) )
   OutStd( "; CASE:", Str( nCase, 6, 2 ), "sec." )
   OutStd( "; IF:", Str( nIf, 6, 2 ), "sec." )
   OutStd( If( nCase < nIf, " -  CASE", ;
         If( nIf < nCase, " -  IF  ", " -  (even)" ) ) )
   IF nExceedsBy > 0
      OutStd( " by", Str( nExceedsBy, 6, 2 ) + "%" )
   ENDIF

RETURN ( NIL )

///////////////////////  END OF MODULE ////////////////////////////

// This output is from running the program without debug.

CaseVsIf: A Utility for Comparing execution times
of the multi-branch decision structures:

DO CASE...ENDCASE versus IF...ELSE...ENDIF

For phases 1 and 3, conditions are character comparisons, such as:

    Chr( nCond ) == ;
    Chr(  1 )

Starting nMaxIters value: 25000
Minimum number of seconds for all results:  5.00

Testing Phase  1 : Find .T. condition then exit structure

Number of iterations: 25000

Cond. #   1; CASE:   6.86 sec.; IF:  14.50 sec. -  CASE by 111.37%
Cond. #   2; CASE:  10.71 sec.; IF:  18.29 sec. -  CASE by  70.77%
Cond. #   3; CASE:  14.66 sec.; IF:  21.97 sec. -  CASE by  49.86%
Cond. #   4; CASE:  18.56 sec.; IF:  25.76 sec. -  CASE by  38.79%
Cond. #   5; CASE:  22.47 sec.; IF:  29.49 sec. -  CASE by  31.24%
Cond. #   6; CASE:  26.42 sec.; IF:  33.23 sec. -  CASE by  25.78%
Cond. #   7; CASE:  30.27 sec.; IF:  36.96 sec. -  CASE by  22.10%
Cond. #   8; CASE:  34.16 sec.; IF:  40.70 sec. -  CASE by  19.15%
Cond. #   9; CASE:  38.06 sec.; IF:  44.49 sec. -  CASE by  16.89%
Cond. #  10; CASE:  42.02 sec.; IF:  48.22 sec. -  CASE by  14.75%
Cond. #  11; CASE:  45.86 sec.; IF:  51.96 sec. -  CASE by  13.30%
Cond. #  12; CASE:  49.76 sec.; IF:  55.70 sec. -  CASE by  11.94%
Cond. #  13; CASE:  53.71 sec.; IF:  59.54 sec. -  CASE by  10.85%
Cond. #  14; CASE:  57.67 sec.; IF:  63.39 sec. -  CASE by   9.92%
Cond. #  15; CASE:  61.51 sec.; IF:  67.12 sec. -  CASE by   9.12%
Cond. #  16; CASE:  65.41 sec.; IF:  70.91 sec. -  CASE by   8.41%
Cond. #  17; CASE:  69.37 sec.; IF:  74.65 sec. -  CASE by   7.61%
Cond. #  18; CASE:  73.32 sec.; IF:  78.38 sec. -  CASE by   6.90%
Cond. #  19; CASE:  77.17 sec.; IF:  82.17 sec. -  CASE by   6.48%
Cond. #  20; CASE:  81.07 sec.; IF:  85.95 sec. -  CASE by   6.02%
Cond. #  21; CASE:  85.03 sec.; IF:  89.64 sec. -  CASE by   5.42%
Cond. #  22; CASE:  88.93 sec.; IF:  93.42 sec. -  CASE by   5.05%
Cond. #  23; CASE:  92.83 sec.; IF:  97.22 sec. -  CASE by   4.73%
Cond. #  24; CASE:  96.78 sec.; IF: 100.95 sec. -  CASE by   4.31%
Cond. #  25; CASE:  96.78 sec.; IF: 100.84 sec. -  CASE by   4.20%


Testing Phase 2 : Stepping time between conditions

Number of iterations: 25000

Timing DO CASE...ENDCASE . . .
(finished timing DO CASE...ENDCASE)

Timing IF...ELSE...ENDIF . . .

(finished timing IF...ELSE...ENDIF)

Results of Phase 2 'stepping' time comparisons:

Cond. #   2; CASE:  46.58 sec.; IF:  46.25 sec. -  IF   by   0.71%
Cond. #   3; CASE:  36.31 sec.; IF:  36.66 sec. -  CASE by   0.96%
Cond. #   4; CASE:  37.10 sec.; IF:  37.93 sec. -  CASE by   2.24%
Cond. #   5; CASE:  37.09 sec.; IF:  41.15 sec. -  CASE by  10.95%
Cond. #   6; CASE:  37.95 sec.; IF:  38.05 sec. -  CASE by   0.26%
Cond. #   7; CASE:  38.52 sec.; IF:  37.89 sec. -  IF   by   1.66%
Cond. #   8; CASE:  38.11 sec.; IF:  37.95 sec. -  IF   by   0.42%
Cond. #   9; CASE:  38.97 sec.; IF:  37.97 sec. -  IF   by   2.63%
Cond. #  10; CASE:  38.61 sec.; IF:  38.73 sec. -  CASE by   0.31%
Cond. #  11; CASE:  38.96 sec.; IF:  38.57 sec. -  IF   by   1.01%
Cond. #  12; CASE:  38.13 sec.; IF:  39.63 sec. -  CASE by   3.93%
Cond. #  13; CASE:  41.20 sec.; IF:  39.49 sec. -  IF   by   4.33%
Cond. #  14; CASE:  35.45 sec.; IF:  40.62 sec. -  CASE by  14.58%
Cond. #  15; CASE:  36.82 sec.; IF:  40.20 sec. -  CASE by   9.18%
Cond. #  16; CASE:  38.26 sec.; IF:  40.45 sec. -  CASE by   5.72%
Cond. #  17; CASE:  38.72 sec.; IF:  40.69 sec. -  CASE by   5.09%
Cond. #  18; CASE:  38.52 sec.; IF:  40.94 sec. -  CASE by   6.28%
Cond. #  19; CASE:  38.64 sec.; IF:  40.92 sec. -  CASE by   5.90%
Cond. #  20; CASE:  37.55 sec.; IF:  40.64 sec. -  CASE by   8.23%
Cond. #  21; CASE:  37.41 sec.; IF:  40.62 sec. -  CASE by   8.58%
Cond. #  22; CASE:  38.98 sec.; IF:  40.40 sec. -  CASE by   3.64%
Cond. #  23; CASE:  38.38 sec.; IF:  40.78 sec. -  CASE by   6.25%
Cond. #  24; CASE:  39.11 sec.; IF:  39.93 sec. -  CASE by   2.10%
Cond. #  25; CASE:  37.86 sec.; IF:  40.82 sec. -  CASE by   7.82%
Cond. #  26; CASE:  38.30 sec.; IF:  40.07 sec. -  CASE by   4.62%

Testing Phase 3 : 'seek' and 'exit' times

Number of iterations: 25000


(Seek):   1; CASE:  45.87 sec.; IF:  45.81 sec. -  IF   by   0.13%
(Exit):   1; CASE:  17.66 sec.; IF:  17.46 sec. -  IF   by   1.15%
(Total)   1; CASE:  63.53 sec.; IF:  63.27 sec. -  IF   by   0.41%

(Seek):   2; CASE:  48.43 sec.; IF:  48.30 sec. -  IF   by   0.27%
(Exit):   2; CASE:  16.51 sec.; IF:  15.26 sec. -  IF   by   8.19%
(Total)   2; CASE:  64.94 sec.; IF:  63.56 sec. -  IF   by   2.17%

(Seek):   3; CASE:  52.75 sec.; IF:  51.70 sec. -  IF   by   2.03%
(Exit):   3; CASE:  16.63 sec.; IF:  15.96 sec. -  IF   by   4.20%
(Total)   3; CASE:  69.38 sec.; IF:  67.66 sec. -  IF   by   2.54%

(Seek):   4; CASE:  57.60 sec.; IF:  56.53 sec. -  IF   by   1.89%
(Exit):   4; CASE:  17.08 sec.; IF:  17.43 sec. -  CASE by   2.05%
(Total)   4; CASE:  74.68 sec.; IF:  73.96 sec. -  IF   by   0.97%

(Seek):   5; CASE:  60.25 sec.; IF:  56.91 sec. -  IF   by   5.87%
(Exit):   5; CASE:  17.11 sec.; IF:  16.25 sec. -  IF   by   5.29%
(Total)   5; CASE:  77.36 sec.; IF:  73.16 sec. -  IF   by   5.74%

(Seek):   6; CASE:  63.42 sec.; IF:  65.41 sec. -  CASE by   3.14%
(Exit):   6; CASE:  16.84 sec.; IF:  19.02 sec. -  CASE by  12.95%
(Total)   6; CASE:  80.26 sec.; IF:  84.43 sec. -  CASE by   5.20%

(Seek):   7; CASE:  70.19 sec.; IF:  67.72 sec. -  IF   by   3.65%
(Exit):   7; CASE:  18.41 sec.; IF:  17.59 sec. -  IF   by   4.66%
(Total)   7; CASE:  88.60 sec.; IF:  85.31 sec. -  IF   by   3.86%

(Seek):   8; CASE:  68.28 sec.; IF:  72.53 sec. -  CASE by   6.22%
(Exit):   8; CASE:  14.65 sec.; IF:  18.16 sec. -  CASE by  23.96%
(Total)   8; CASE:  82.93 sec.; IF:  90.69 sec. -  CASE by   9.36%

(Seek):   9; CASE:  77.15 sec.; IF:  75.19 sec. -  IF   by   2.61%
(Exit):   9; CASE:  17.32 sec.; IF:  17.97 sec. -  CASE by   3.75%
(Total)   9; CASE:  94.47 sec.; IF:  93.16 sec. -  IF   by   1.41%

(Seek):  10; CASE:  81.25 sec.; IF:  79.11 sec. -  IF   by   2.71%
(Exit):  10; CASE:  17.17 sec.; IF:  17.90 sec. -  CASE by   4.25%
(Total)  10; CASE:  98.42 sec.; IF:  97.01 sec. -  IF   by   1.45%

(Seek):  11; CASE:  84.41 sec.; IF:  82.40 sec. -  IF   by   2.44%
(Exit):  11; CASE:  16.54 sec.; IF:  16.48 sec. -  IF   by   0.36%
(Total)  11; CASE: 100.95 sec.; IF:  98.88 sec. -  IF   by   2.09%

(Seek):  12; CASE:  88.10 sec.; IF:  84.66 sec. -  IF   by   4.06%
(Exit):  12; CASE:  17.36 sec.; IF:  15.77 sec. -  IF   by  10.08%
(Total)  12; CASE: 105.46 sec.; IF: 100.43 sec. -  IF   by   5.01%

(Seek):  13; CASE:  92.41 sec.; IF:  89.50 sec. -  IF   by   3.25%
(Exit):  13; CASE:  17.98 sec.; IF:  15.94 sec. -  IF   by  12.80%
(Total)  13; CASE: 110.39 sec.; IF: 105.44 sec. -  IF   by   4.69%

(Seek):  14; CASE:  96.25 sec.; IF:  93.82 sec. -  IF   by   2.59%
(Exit):  14; CASE:  15.83 sec.; IF:  17.31 sec. -  CASE by   9.35%
(Total)  14; CASE: 112.08 sec.; IF: 111.13 sec. -  IF   by   0.85%

(Seek):  15; CASE: 101.35 sec.; IF:  99.07 sec. -  IF   by   2.30%
(Exit):  15; CASE:  18.12 sec.; IF:  20.62 sec. -  CASE by  13.80%
(Total)  15; CASE: 119.47 sec.; IF: 119.69 sec. -  CASE by   0.18%

(Seek):  16; CASE: 106.38 sec.; IF: 101.68 sec. -  IF   by   4.62%
(Exit):  16; CASE:  21.48 sec.; IF:  17.76 sec. -  IF   by  20.95%
(Total)  16; CASE: 127.86 sec.; IF: 119.44 sec. -  IF   by   7.05%

(Seek):  17; CASE: 110.54 sec.; IF: 105.41 sec. -  IF   by   4.87%
(Exit):  17; CASE:  19.83 sec.; IF:  16.64 sec. -  IF   by  19.17%
(Total)  17; CASE: 130.37 sec.; IF: 122.05 sec. -  IF   by   6.82%

(Seek):  18; CASE: 112.26 sec.; IF: 108.12 sec. -  IF   by   3.83%
(Exit):  18; CASE:  13.42 sec.; IF:  12.02 sec. -  IF   by  11.65%
(Total)  18; CASE: 125.68 sec.; IF: 120.14 sec. -  IF   by   4.61%

(Seek):  19; CASE: 116.64 sec.; IF: 113.25 sec. -  IF   by   2.99%
(Exit):  19; CASE:  13.40 sec.; IF:  13.46 sec. -  CASE by   0.45%
(Total)  19; CASE: 130.04 sec.; IF: 126.71 sec. -  IF   by   2.63%

(Seek):  20; CASE: 119.97 sec.; IF: 116.14 sec. -  IF   by   3.30%
(Exit):  20; CASE:  12.94 sec.; IF:  14.73 sec. -  CASE by  13.83%
(Total)  20; CASE: 132.91 sec.; IF: 130.87 sec. -  IF   by   1.56%

(Seek):  21; CASE: 121.86 sec.; IF: 122.45 sec. -  CASE by   0.48%
(Exit):  21; CASE:  12.84 sec.; IF:  11.99 sec. -  IF   by   7.09%
(Total)  21; CASE: 134.70 sec.; IF: 134.44 sec. -  IF   by   0.19%

(Seek):  22; CASE: 127.79 sec.; IF: 122.70 sec. -  IF   by   4.15%
(Exit):  22; CASE:  12.33 sec.; IF:  12.15 sec. -  IF   by   1.48%
(Total)  22; CASE: 140.12 sec.; IF: 134.85 sec. -  IF   by   3.91%

(Seek):  23; CASE: 132.53 sec.; IF: 127.02 sec. -  IF   by   4.34%
(Exit):  23; CASE:  14.64 sec.; IF:  12.27 sec. -  IF   by  19.32%
(Total)  23; CASE: 147.17 sec.; IF: 139.29 sec. -  IF   by   5.66%

(Seek):  24; CASE: 136.39 sec.; IF: 130.90 sec. -  IF   by   4.19%
(Exit):  24; CASE:  12.51 sec.; IF:  12.12 sec. -  IF   by   3.22%
(Total)  24; CASE: 148.90 sec.; IF: 143.02 sec. -  IF   by   4.11%

(Seek):  25; CASE: 136.29 sec.; IF: 130.67 sec. -  IF   by   4.30%
(Exit):  25; CASE:  13.18 sec.; IF:  11.66 sec. -  IF   by  13.04%
(Total)  25; CASE: 149.47 sec.; IF: 142.33 sec. -  IF   by   5.02%

-+-+-+ End of Test +-+-+-

// This output is from running the program _with_ debug.

CaseVsIf: A Utility for Comparing execution times
of the multi-branch decision structures:

DO CASE...ENDCASE versus IF...ELSE...ENDIF

For phases 1 and 3, conditions are character comparisons, such as:

    Chr( nCond ) == ;
    Chr(  1 )

Starting nMaxIters value: 25000
Minimum number of seconds for all results:  5.00

Testing Phase  1 : Find .T. condition then exit structure

Number of iterations: 25000

Cond. #   1; CASE:  19.11 sec.; IF:  20.93 sec. -  CASE by   9.52%
Cond. #   2; CASE:  29.11 sec.; IF:  24.83 sec. -  IF   by  17.24%
Cond. #   3; CASE:  39.11 sec.; IF:  28.72 sec. -  IF   by  36.18%
Cond. #   4; CASE:  49.22 sec.; IF:  32.62 sec. -  IF   by  50.89%
Cond. #   5; CASE:  59.27 sec.; IF:  36.47 sec. -  IF   by  62.52%
Cond. #   6; CASE:  69.32 sec.; IF:  40.42 sec. -  IF   by  71.50%
Cond. #   7; CASE:  79.37 sec.; IF:  44.27 sec. -  IF   by  79.29%
Cond. #   8; CASE:  89.42 sec.; IF:  48.23 sec. -  IF   by  85.40%
Cond. #   9; CASE:  99.41 sec.; IF:  52.12 sec. -  IF   by  90.73%
Cond. #  10; CASE: 109.47 sec.; IF:  56.02 sec. -  IF   by  95.41%
Cond. #  11; CASE: 119.52 sec.; IF:  59.87 sec. -  IF   by  99.63%
Cond. #  12; CASE: 129.57 sec.; IF:  63.82 sec. -  IF   by 103.02%
Cond. #  13; CASE: 139.62 sec.; IF:  67.83 sec. -  IF   by 105.84%
Cond. #  14; CASE: 149.61 sec.; IF:  71.85 sec. -  IF   by 108.23%
Cond. #  15; CASE: 159.72 sec.; IF:  75.69 sec. -  IF   by 111.02%
Cond. #  16; CASE: 169.72 sec.; IF:  79.59 sec. -  IF   by 113.24%
Cond. #  17; CASE: 179.83 sec.; IF:  83.48 sec. -  IF   by 115.42%
Cond. #  18; CASE: 189.82 sec.; IF:  87.45 sec. -  IF   by 117.06%
Cond. #  19; CASE: 199.93 sec.; IF:  91.28 sec. -  IF   by 119.03%
Cond. #  20; CASE: 209.93 sec.; IF:  95.18 sec. -  IF   by 120.56%
Cond. #  21; CASE: 219.97 sec.; IF:  99.09 sec. -  IF   by 121.99%
Cond. #  22; CASE: 230.03 sec.; IF: 103.04 sec. -  IF   by 123.24%
Cond. #  23; CASE: 240.08 sec.; IF: 106.88 sec. -  IF   by 124.63%
Cond. #  24; CASE: 250.07 sec.; IF: 110.79 sec. -  IF   by 125.72%
Cond. #  25; CASE: 256.01 sec.; IF: 110.67 sec. -  IF   by 131.33%


Testing Phase 2 : Stepping time between conditions

Number of iterations: 25000

Timing DO CASE...ENDCASE . . .
(finished timing DO CASE...ENDCASE)

Timing IF...ELSE...ENDIF . . .

(finished timing IF...ELSE...ENDIF)

Results of Phase 2 'stepping' time comparisons:

Cond. #   2; CASE: 101.88 sec.; IF:  95.82 sec. -  IF   by   6.32%
Cond. #   3; CASE:  76.15 sec.; IF:  72.22 sec. -  IF   by   5.44%
Cond. #   4; CASE:  74.99 sec.; IF:  68.93 sec. -  IF   by   8.79%
Cond. #   5; CASE:  76.02 sec.; IF:  76.00 sec. -  IF   by   0.03%
Cond. #   6; CASE:  76.19 sec.; IF:  69.40 sec. -  IF   by   9.78%
Cond. #   7; CASE:  77.80 sec.; IF:  71.71 sec. -  IF   by   8.49%
Cond. #   8; CASE:  77.42 sec.; IF:  70.43 sec. -  IF   by   9.92%
Cond. #   9; CASE:  76.32 sec.; IF:  69.37 sec. -  IF   by  10.02%
Cond. #  10; CASE:  74.97 sec.; IF:  70.61 sec. -  IF   by   6.17%
Cond. #  11; CASE:  76.14 sec.; IF:  68.47 sec. -  IF   by  11.20%
Cond. #  12; CASE:  76.16 sec.; IF:  71.60 sec. -  IF   by   6.37%
Cond. #  13; CASE:  80.62 sec.; IF:  69.44 sec. -  IF   by  16.10%
Cond. #  14; CASE:  75.98 sec.; IF:  72.75 sec. -  IF   by   4.44%
Cond. #  15; CASE:  76.05 sec.; IF:  69.42 sec. -  IF   by   9.55%
Cond. #  16; CASE:  77.05 sec.; IF:  70.95 sec. -  IF   by   8.60%
Cond. #  17; CASE:  75.15 sec.; IF:  69.29 sec. -  IF   by   8.46%
Cond. #  18; CASE:  76.15 sec.; IF:  72.08 sec. -  IF   by   5.65%
Cond. #  19; CASE:  74.70 sec.; IF:  68.90 sec. -  IF   by   8.42%
Cond. #  20; CASE:  77.20 sec.; IF:  70.53 sec. -  IF   by   9.46%
Cond. #  21; CASE:  76.97 sec.; IF:  69.83 sec. -  IF   by  10.22%
Cond. #  22; CASE:  76.70 sec.; IF:  70.44 sec. -  IF   by   8.89%
Cond. #  23; CASE:  76.52 sec.; IF:  70.45 sec. -  IF   by   8.62%
Cond. #  24; CASE:  73.90 sec.; IF:  69.53 sec. -  IF   by   6.29%
Cond. #  25; CASE:  76.51 sec.; IF:  69.27 sec. -  IF   by  10.45%
Cond. #  26; CASE:  82.49 sec.; IF:  75.11 sec. -  IF   by   9.83%

Testing Phase 3 : 'seek' and 'exit' times

Number of iterations: 25000


(Seek):   1; CASE:  71.07 sec.; IF:  63.98 sec. -  IF   by  11.08%
(Exit):   1; CASE:  24.12 sec.; IF:  22.90 sec. -  IF   by   5.33%
(Total)   1; CASE:  95.19 sec.; IF:  86.88 sec. -  IF   by   9.56%

(Seek):   2; CASE:  80.22 sec.; IF:  71.22 sec. -  IF   by  12.64%
(Exit):   2; CASE:  24.86 sec.; IF:  27.77 sec. -  CASE by  11.71%
(Total)   2; CASE: 105.08 sec.; IF:  98.99 sec. -  IF   by   6.15%

(Seek):   3; CASE:  93.15 sec.; IF:  71.45 sec. -  IF   by  30.37%
(Exit):   3; CASE:  24.70 sec.; IF:  23.03 sec. -  IF   by   7.25%
(Total)   3; CASE: 117.85 sec.; IF:  94.48 sec. -  IF   by  24.74%

(Seek):   4; CASE: 102.75 sec.; IF:  74.72 sec. -  IF   by  37.51%
(Exit):   4; CASE:  24.84 sec.; IF:  22.67 sec. -  IF   by   9.57%
(Total)   4; CASE: 127.59 sec.; IF:  97.39 sec. -  IF   by  31.01%

(Seek):   5; CASE: 111.95 sec.; IF:  79.51 sec. -  IF   by  40.80%
(Exit):   5; CASE:  22.55 sec.; IF:  23.11 sec. -  CASE by   2.48%
(Total)   5; CASE: 134.50 sec.; IF: 102.62 sec. -  IF   by  31.07%

(Seek):   6; CASE: 121.55 sec.; IF:  84.20 sec. -  IF   by  44.36%
(Exit):   6; CASE:  25.00 sec.; IF:  22.77 sec. -  IF   by   9.79%
(Total)   6; CASE: 146.55 sec.; IF: 106.97 sec. -  IF   by  37.00%

(Seek):   7; CASE: 130.04 sec.; IF:  84.60 sec. -  IF   by  53.71%
(Exit):   7; CASE:  24.47 sec.; IF:  21.42 sec. -  IF   by  14.24%
(Total)   7; CASE: 154.51 sec.; IF: 106.02 sec. -  IF   by  45.74%

(Seek):   8; CASE: 141.00 sec.; IF:  93.28 sec. -  IF   by  51.16%
(Exit):   8; CASE:  24.83 sec.; IF:  24.96 sec. -  CASE by   0.52%
(Total)   8; CASE: 165.83 sec.; IF: 118.24 sec. -  IF   by  40.25%

(Seek):   9; CASE: 151.02 sec.; IF:  98.68 sec. -  IF   by  53.04%
(Exit):   9; CASE:  23.97 sec.; IF:  26.12 sec. -  CASE by   8.97%
(Total)   9; CASE: 174.99 sec.; IF: 124.80 sec. -  IF   by  40.22%

(Seek):  10; CASE: 159.53 sec.; IF:  98.05 sec. -  IF   by  62.70%
(Exit):  10; CASE:  22.60 sec.; IF:  22.25 sec. -  IF   by   1.57%
(Total)  10; CASE: 182.13 sec.; IF: 120.30 sec. -  IF   by  51.40%

(Seek):  11; CASE: 173.09 sec.; IF:  98.10 sec. -  IF   by  76.44%
(Exit):  11; CASE:  24.69 sec.; IF:  20.68 sec. -  IF   by  19.39%
(Total)  11; CASE: 197.78 sec.; IF: 118.78 sec. -  IF   by  66.51%

(Seek):  12; CASE: 180.07 sec.; IF: 104.22 sec. -  IF   by  72.78%
(Exit):  12; CASE:  22.18 sec.; IF:  21.50 sec. -  IF   by   3.16%
(Total)  12; CASE: 202.25 sec.; IF: 125.72 sec. -  IF   by  60.87%

(Seek):  13; CASE: 191.61 sec.; IF: 112.11 sec. -  IF   by  70.91%
(Exit):  13; CASE:  23.26 sec.; IF:  24.52 sec. -  CASE by   5.42%
(Total)  13; CASE: 214.87 sec.; IF: 136.63 sec. -  IF   by  57.26%

(Seek):  14; CASE: 200.83 sec.; IF: 115.85 sec. -  IF   by  73.35%
(Exit):  14; CASE:  22.54 sec.; IF:  25.18 sec. -  CASE by  11.71%
(Total)  14; CASE: 223.37 sec.; IF: 141.03 sec. -  IF   by  58.38%

(Seek):  15; CASE: 210.88 sec.; IF: 116.20 sec. -  IF   by  81.48%
(Exit):  15; CASE:  24.84 sec.; IF:  22.17 sec. -  IF   by  12.04%
(Total)  15; CASE: 235.72 sec.; IF: 138.37 sec. -  IF   by  70.35%

(Seek):  16; CASE: 221.39 sec.; IF: 122.54 sec. -  IF   by  80.67%
(Exit):  16; CASE:  24.76 sec.; IF:  23.58 sec. -  IF   by   5.00%
(Total)  16; CASE: 246.15 sec.; IF: 146.12 sec. -  IF   by  68.46%

(Seek):  17; CASE: 231.90 sec.; IF: 126.54 sec. -  IF   by  83.26%
(Exit):  17; CASE:  23.53 sec.; IF:  24.09 sec. -  CASE by   2.38%
(Total)  17; CASE: 255.43 sec.; IF: 150.63 sec. -  IF   by  69.57%

(Seek):  18; CASE: 240.28 sec.; IF: 130.14 sec. -  IF   by  84.63%
(Exit):  18; CASE:  18.79 sec.; IF:  19.41 sec. -  CASE by   3.30%
(Total)  18; CASE: 259.07 sec.; IF: 149.55 sec. -  IF   by  73.23%

(Seek):  19; CASE: 254.25 sec.; IF: 133.24 sec. -  IF   by  90.82%
(Exit):  19; CASE:  20.11 sec.; IF:  20.77 sec. -  CASE by   3.28%
(Total)  19; CASE: 274.36 sec.; IF: 154.01 sec. -  IF   by  78.14%

(Seek):  20; CASE: 261.81 sec.; IF: 135.74 sec. -  IF   by  92.88%
(Exit):  20; CASE:  20.06 sec.; IF:  18.75 sec. -  IF   by   6.99%
(Total)  20; CASE: 281.87 sec.; IF: 154.49 sec. -  IF   by  82.45%

(Seek):  21; CASE: 272.18 sec.; IF: 141.29 sec. -  IF   by  92.64%
(Exit):  21; CASE:  20.66 sec.; IF:  20.13 sec. -  IF   by   2.63%
(Total)  21; CASE: 292.84 sec.; IF: 161.42 sec. -  IF   by  81.41%

(Seek):  22; CASE: 282.66 sec.; IF: 145.96 sec. -  IF   by  93.66%
(Exit):  22; CASE:  20.35 sec.; IF:  20.33 sec. -  IF   by   0.10%
(Total)  22; CASE: 303.01 sec.; IF: 166.29 sec. -  IF   by  82.22%

(Seek):  23; CASE: 291.47 sec.; IF: 147.89 sec. -  IF   by  97.09%
(Exit):  23; CASE:  20.26 sec.; IF:  21.39 sec. -  CASE by   5.58%
(Total)  23; CASE: 311.73 sec.; IF: 169.28 sec. -  IF   by  84.15%

(Seek):  24; CASE: 305.90 sec.; IF: 151.36 sec. -  IF   by 102.10%
(Exit):  24; CASE:  25.39 sec.; IF:  19.21 sec. -  IF   by  32.17%
(Total)  24; CASE: 331.29 sec.; IF: 170.57 sec. -  IF   by  94.23%

(Seek):  25; CASE: 306.46 sec.; IF: 151.94 sec. -  IF   by 101.70%
(Exit):  25; CASE:  18.36 sec.; IF:  19.62 sec. -  CASE by   6.86%
(Total)  25; CASE: 324.82 sec.; IF: 171.56 sec. -  IF   by  89.33%

-+-+-+ End of Test +-+-+-
