home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / MISC / DOFOR.PRG < prev    next >
Encoding:
Text File  |  1993-02-01  |  930 b   |  25 lines

  1. *****************************************************************
  2. *     * 09/92               DOFOR.PRG                          *
  3. *****************************************************************
  4. *     * Author's Name: Jeb Long                                 *
  5. *     *                                                         *
  6. *     * Description:                                            *
  7. *     * This program compares the speed between DO and FOR      *
  8. *     *                                                         *
  9. *****************************************************************
  10. *
  11. SET TALK OFF
  12. start = SECONDS()
  13. counter = 1
  14. DO WHILE counter < 10000
  15.     counter = counter + 1
  16. ENDDO
  17. DOfinish = SECONDS()    
  18. FOR counter=1 TO 10000
  19. ENDFOR
  20. FORfinish = SECONDS()
  21. ? "For 10000 iterations:"
  22. ? " DO WHILE loop took", DOfinish-start, "seconds"
  23. ? " FOR loop took     ", FORfinish-DOfinish, "seconds"
  24. RETURN
  25.