Serial.printf("Creating %dKB file, may take a while...\n",TESTSIZEKB);
longstart=millis();
unsignedlongstart=millis();
Filef=fs->open("/testwrite.bin","w");
if(!f){
Serial.printf("Unable to open file for writing, aborting\n");
...
...
@@ -41,11 +60,11 @@ void DoTest(FS *fs) {
}
}
f.close();
longstop=millis();
Serial.printf("==> Time to write %dKB in 256b chunks = %ld milliseconds\n",TESTSIZEKB,stop-start);
unsignedlongstop=millis();
Serial.printf("==> Time to write %dKB in 256b chunks = %lu milliseconds\n",TESTSIZEKB,stop-start);
f=fs->open("/testwrite.bin","r");
Serial.printf("==> Created file size = %d\n",f.size());
Serial.printf("==> Created file size = %zu\n",f.size());
f.close();
Serial.printf("Reading %dKB file sequentially in 256b chunks\n",TESTSIZEKB);
...
...
@@ -58,7 +77,7 @@ void DoTest(FS *fs) {
}
f.close();
stop=millis();
Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %ld milliseconds = %ld bytes/s\n",TESTSIZEKB,stop-start,TESTSIZEKB*1024/(stop-start)*1000);
Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %lu milliseconds = %s\n",TESTSIZEKB,stop-start,rate(start,stop,TESTSIZEKB*1024));
Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n",TESTSIZEKB);
start=millis();
...
...
@@ -71,8 +90,7 @@ void DoTest(FS *fs) {
}
f.close();
stop=millis();
Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = %ld milliseconds = %ld bytes/s\n",TESTSIZEKB,stop-start,TESTSIZEKB*1024/(stop-start)*1000);
Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = %lu milliseconds = %s\n",TESTSIZEKB,stop-start,rate(start,stop,TESTSIZEKB*1024));
Serial.printf("Reading %dKB file in reverse by 256b chunks\n",TESTSIZEKB);
start=millis();
...
...
@@ -91,8 +109,7 @@ void DoTest(FS *fs) {
}
f.close();
stop=millis();
Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %ld milliseconds = %ld bytes/s\n",TESTSIZEKB,stop-start,TESTSIZEKB*1024/(stop-start)*1000);
Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %lu milliseconds = %s\n",TESTSIZEKB,stop-start,rate(start,stop,TESTSIZEKB*1024));
Serial.printf("Writing 64K file in 1-byte chunks\n");
start=millis();
...
...
@@ -102,7 +119,7 @@ void DoTest(FS *fs) {
}
f.close();
stop=millis();
Serial.printf("==> Time to write 64KB in 1b chunks = %ld milliseconds = %ld bytes/s\n",stop-start,65536/(stop-start)*1000);
Serial.printf("==> Time to write 64KB in 1b chunks = %lu milliseconds = %s\n",stop-start,rate(start,stop,65536));
Serial.printf("Reading 64K file in 1-byte chunks\n");
start=millis();
...
...
@@ -113,9 +130,7 @@ void DoTest(FS *fs) {
}
f.close();
stop=millis();
Serial.printf("==> Time to read 64KB in 1b chunks = %ld milliseconds = %ld bytes/s\n",stop-start,65536/(stop-start)*1000);
Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n",stop-start,rate(start,stop,65536));