home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1990 / USERAU90.MSA / LISTINGS.ARC / DSKBMARK.BAS < prev    next >
BASIC Source File  |  1990-06-25  |  2KB  |  77 lines

  1. REM Disk drive benchmarks
  2.  
  3. ?:? " Calculating disk benchmarks...":?
  4.  
  5. REM ----- Write 500k block -----
  6. DIM a%(260000)
  7. t! = TIMER
  8. BSAVE "test.dat",VARPTR(a%(0)),512000
  9. t! = TIMER - t!
  10. ? " Time to write 500k =";t!;"s"
  11.  
  12. REM ----- Read 500k block -----
  13. t! = TIMER
  14. BLOAD "test.dat",VARPTR(a%(0))
  15. t! = TIMER - t!
  16. ? " Time to read 500k =";t!;"s"
  17.  
  18. REM ----- Write 30,000 bytes forwards -----
  19. t! = TIMER
  20. OPEN "R",#1,"test.dat",1
  21. FIELD #1,1 AS buffer$
  22. LSET buffer$ = CHR$(0)
  23. FOR i% = 1 TO 30000
  24.     PUT #1
  25. NEXT
  26. CLOSE #1
  27. t! = TIMER - t!
  28. ? " Time to write 30,000 bytes forwards =";t!;"s"
  29.  
  30. REM ----- Read 30,000 bytes forwards -----
  31. t! = TIMER
  32. OPEN "R",#2,"test.dat",1
  33. FIELD #2,1 AS buffer$
  34. FOR i% = 1 TO 30000
  35.     GET #2
  36. NEXT
  37. CLOSE #2
  38. t! = TIMER - t!
  39. ? " Time to read 30,000 bytes forwards =";t!;"s"
  40.  
  41. REM ----- Write 30,000 bytes backwards -----
  42. t! = TIMER
  43. OPEN "R",#3,"test.dat",1
  44. FIELD #3,1 AS buffer$
  45. LSET buffer$ = CHR$(0)
  46. FOR i% = 30000 TO 1 STEP -1
  47.     PUT #3,i%
  48. NEXT
  49. CLOSE #3
  50. t! = TIMER - t!
  51. ? " Time to write 30,000 bytes backwards =";t!;"s"
  52.  
  53. REM ----- Read 30,000 bytes backwards -----
  54. t! = TIMER
  55. OPEN "R",#4,"test.dat",1
  56. FIELD #4,1 AS buffer$
  57. FOR i% = 30000 TO 1 STEP -1
  58.     GET #4,i%
  59. NEXT
  60. CLOSE #4
  61. t! = TIMER - t!
  62. ? " Time to read 30,000 bytes backwards =";t!;"s"
  63.  
  64. REM ----- Seek test reading 30,000 bytes -----
  65. t! = TIMER
  66. OPEN "R",#5,"test.dat",1
  67. FIELD #5,1 AS buffer$
  68. FOR i% = 1 TO 29999
  69.     GET #5,i%
  70.     GET #5,30000-i%
  71. NEXT
  72. CLOSE #5
  73. t! = TIMER - t!
  74. ? " Time for seek test =";t!;"s"
  75.  
  76. END
  77.