说明:一般产品都会标明:从USB接口的Flash存储器读取数据的速度不低于600KB/S.
我的方法(编程):从闪存盘拷贝一个30MB的文件,每次读1KB写到硬盘上。然后统计所用时间。做除法得到速率,但是一般都在33792KB/S。我的方法是否有问题?速度也太快了吧?

解决方案 »

  1.   

    Open "f:\30M.txt" For Binary Access Read As sourcefile1
    Open "f:\1K.txt" For Binary Access Read As sourcefile3
    Open "c:\zjgl.txt" For Binary Access Write As sourcefile2
    ReDim bytedata(1 To LOF(sourcefile3))temp_old = CDate(Now)
    For i = 1 To 30
       Get sourcefile1, , bytedata()
       Put sourcefile2, , bytedata()
    Next i
    Close sourcefile1
    Close sourcefile2
    close sourcefile3
    temp_new = CDate(Now)
    temp_sub = CDate(temp_new - temp_old)
    temp_s = Second(temp_sub)
    temp_h = Hour(temp_sub)
    temp_m = Minute(temp_sub)
    temp_h = (temp_h * 3600)
    temp_m = (temp_m * 60)
    temp_sum = temp_s + temp_h + temp_m
    temp_num1 = total_num * 1024
    temp_div = temp_num1 / temp_sum
      

  2.   

    改成这样速度仍很快!
    Open "f:\30M.txt" For Binary Access Read As sourcefile1
    Open "f:\1K.txt" For Binary Access Read As sourcefile3
    Open "c:\zjgl.txt" For Binary Access Write As sourcefile2
    ReDim bytedata(1 To LOF(sourcefile3))temp_old = CDate(Now)
    For i = 1 To (30*1024)
       Get sourcefile1, , bytedata()
       Put sourcefile2, , bytedata()
    Next i
    Close sourcefile1
    Close sourcefile2
    close sourcefile3
    temp_new = CDate(Now)
    temp_sub = CDate(temp_new - temp_old)
    temp_s = Second(temp_sub)
    temp_h = Hour(temp_sub)
    temp_m = Minute(temp_sub)
    temp_h = (temp_h * 3600)
    temp_m = (temp_m * 60)
    temp_sum = temp_s + temp_h + temp_m
    temp_num1 = total_num * 1024
    temp_div = temp_num1 / temp_sum
      

  3.   

    修改下 
    ReDim bytedata(1 To 1024)temp_old = timertemp_new = timertemp_sum =temp_new-temp_old删除这些
    temp_sub = CDate(temp_new - temp_old)
    temp_s = Second(temp_sub)
    temp_h = Hour(temp_sub)
    temp_m = Minute(temp_sub)
    temp_h = (temp_h * 3600)
    temp_m = (temp_m * 60)