home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY4 / TTDIR1.ZIP / TTEST5.BAS < prev    next >
BASIC Source File  |  1990-11-24  |  2KB  |  71 lines

  1. '
  2. '  Timing test using the two directory routines I wrote.
  3. '  This program very slow running program!
  4. '
  5.  
  6.  
  7. $LINK "TTDIR105.PBU"
  8. $LINK "TTDIR101.PBU"
  9. $LINK "TTDIR100.PBU"
  10.  
  11. ' Arrays for old sub-routine:
  12.  
  13. DIM UDir$(255)
  14.  
  15.  
  16. ' Arrays for new sub-routine:
  17.  
  18. DIM UD$(255, 3), FFD%(255,6), FFS&(255)
  19.  
  20. %MaxRuns = 100
  21.  
  22. Path$ = COMMAND$
  23. IF Path$ = "" THEN
  24.   Path$ = "*.*"
  25. END IF
  26.  
  27. N% = 0
  28.  
  29. CLS
  30.  
  31. PRINT "Kick back and take it easy."
  32. PRINT
  33. PRINT
  34. PRINT "The author of this program developed these programs using an IBM PS/2"
  35. PRINT "model 50 (runs around 8mHz).  The program took about 2 minutes on that"
  36. PRINT "machine (I haven't bought a math chip yet!)."
  37. PRINT ""
  38. PRINT "This program is calling each sub-routine ";
  39. PRINT %MaxRuns
  40. PRINT "times without printing the directory on the screen.  This should give"
  41. PRINT "you a good idea of the speed differences between the three versions of"
  42. PRINT "the sub-routines."
  43. PRINT
  44. PRINT
  45.  
  46. UStart0! = TIMER
  47. FOR J% = 1 TO %MaxRuns
  48.   CALL GetDir100(Path$, UDir$(), N%)
  49. NEXT J%
  50. UEnd0! = TIMER
  51.  
  52. UStart! = TIMER
  53. FOR J% = 1 TO %MaxRuns
  54.   CALL GetDir(Path$, UDir$(), N%)
  55. NEXT J%
  56. UEnd! = TIMER
  57.  
  58. UStart2! = TIMER
  59. FOR J% = 1 TO %MaxRuns
  60.   CALL GetDirectory(Path$, UD$(), FFD%(), FFS&(), N%)
  61. NEXT J%
  62. UEnd2! = TIMER
  63.  
  64. PRINT       "Original Version routine took:      ";
  65. PRINT USING "######.### Seconds"; UEnd0!  - UStart0!
  66. PRINT       "Original Version modified slightly: ";
  67. PRINT USING "######.### Seconds"; UEnd!  - UStart!
  68. PRINT       "Version 1.05 took.................: ";
  69. PRINT USING "######.### Seconds"; UEnd2! - UStart2!
  70.  
  71.