Changeset 74 for hacks/xtide/atarwbuf.c
- Timestamp:
- Dec 21, 2015, 1:40:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
hacks/xtide/atarwbuf.c
r73 r74 29 29 #include <io.h> 30 30 #include <conio.h> 31 #include <time.h> 31 32 32 33 #include "atalib.h" … … 40 41 int rc; 41 42 unsigned i; 43 uint32_t cSectors; 44 clock_t tsStart; 45 clock_t cTicksElapsed; 42 46 43 47 rc = AtaInitFromArgv(1, argc, argv); … … 64 68 } 65 69 70 /* 71 * Do some performance testing. 72 */ 73 /* read */ 74 cSectors = 0; 75 cTicksElapsed = clock(); 76 do 77 tsStart = clock(); 78 while (tsStart == cTicksElapsed); 79 do 80 { 81 rc = AtaReadBuffer(s_abBuf2, 0 /*fExtraChecks*/); 82 if (rc == 0) 83 rc = AtaReadBuffer(s_abBuf2, 0 /*fExtraChecks*/); 84 if (rc != 0) 85 return 1; 86 cSectors += 2; 87 cTicksElapsed = clock() - tsStart; 88 } while (cTicksElapsed < CLOCKS_PER_SEC * 2); 89 cSectors >>= 1; 90 printf("Read: %lu bytes/sec (%u sec/s)\n", cSectors * 512, cSectors); 91 92 /* write */ 93 cSectors = 0; 94 cTicksElapsed = clock(); 95 do 96 tsStart = clock(); 97 while (tsStart == cTicksElapsed); 98 do 99 { 100 rc = AtaWriteBuffer(s_abBuf1, 0 /*fExtraChecks*/); 101 if (rc == 0) 102 rc = AtaWriteBuffer(s_abBuf1, 0 /*fExtraChecks*/); 103 if (rc != 0) 104 return 1; 105 cSectors += 2; 106 cTicksElapsed = clock() - tsStart; 107 } while (cTicksElapsed < CLOCKS_PER_SEC * 2); 108 cSectors >>= 1; 109 printf("Write: %lu bytes/sec (%u sec/s)\n", cSectors * 512, cSectors); 110 111 66 112 return 0; 67 113 } 68 114 69
Note:
See TracChangeset
for help on using the changeset viewer.