usb3.0 hub连接两个移动硬盘速度测试。
#include "stdio.h"
#include <time.h>
#include <pthread.h>
#define DATA_TRANSFER_SIZE 4096
#define LOOP_NUM 1000000
#define THREAD_NUM 2
void *thread0(void *param)
{
FILE *pFile;
unsigned char buff[DATA_TRANSFER_SIZE]={0};
int i;
pFile = fopen("/sdb1/test.txt","w");
if(NULL == pFile)
{
printf("fopen error\n");
return;
}
for(i=0; i<LOOP_NUM; i++)
{
fwrite(buff,DATA_TRANSFER_SIZE,1,pFile);
}
fclose(pFile);
}
void *thread1(void *param)
{
FILE *pFile;
unsigned char buff[DATA_TRANSFER_SIZE]={0};
int i;
pFile = fopen("/sdc1/test.txt","w");
if(NULL == pFile