Changeset 74 for hacks/xtide/atarwbuf.c


Ignore:
Timestamp:
Dec 21, 2015, 1:40:51 AM (10 years ago)
Author:
bird
Message:

xtide util hacking, included bios patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hacks/xtide/atarwbuf.c

    r73 r74  
    2929#include <io.h>
    3030#include <conio.h>
     31#include <time.h>
    3132
    3233#include "atalib.h"
     
    4041    int             rc;
    4142    unsigned        i;
     43    uint32_t        cSectors;
     44    clock_t         tsStart;
     45    clock_t         cTicksElapsed;
    4246
    4347    rc = AtaInitFromArgv(1, argc, argv);
     
    6468    }
    6569
     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
    66112    return 0;
    67113}
    68114
    69 
Note: See TracChangeset for help on using the changeset viewer.