新手上路
- 积分
- 32
- 金钱
- 32
- 注册时间
- 2016-10-31
- 在线时间
- 3 小时
|

楼主 |
发表于 2016-11-9 12:01:34
|
显示全部楼层
这是我测试读写速度的程序:
[mw_shl_code=c,true]printf("Write single sector time begin ...\r\n");
couter_time = 0;
TIM_Cmd(TIM3, ENABLE);
for(i=0; i<10000; i++)
{
SDCARD_Write_Sector(read_write_buf,1000+i,1);
}
TIM_Cmd(TIM3, DISABLE);
printf("Write single sector time over ...\r\n");
printf("write single: time=%d s \r\n",couter_time);
printf("write single: speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120
printf("Read single sector time begin ...\r\n");
couter_time = 0;
TIM_Cmd(TIM3, ENABLE);
for(i=0; i<10000; i++)
{
SDCARD_Read_Sector(read_write_buf,1000+i,1);
}
TIM_Cmd(TIM3, DISABLE);
printf("Read single sector time over ...\r\n");
printf("Read single : time=%d s \r\n",couter_time);
printf("Read single : speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120
printf("Write multi sector time begin ...\r\n");
couter_time = 0;
TIM_Cmd(TIM3, ENABLE);
for(i=0; i<10000; i+=20)
{
while( SDCARD_Write_Sector(read_write_buf,20000+i,20) == 0xff){};
}
TIM_Cmd(TIM3, DISABLE);
printf("Write multi sector time over ...\r\n");
printf("write multi: time=%d s \r\n",couter_time);
printf("write multi: speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120
printf("Read multi sector time begin ...\r\n");
couter_time = 0;
TIM_Cmd(TIM3, ENABLE);
for(i=0; i<10000; i+=20)
{
while( SDCARD_Read_Sector(read_write_buf,20000+i,20) == 0xff ){};
}
TIM_Cmd(TIM3, DISABLE);
printf("Read multi sector time over ...\r\n");
printf("Read multi : time=%d s \r\n",couter_time);
printf("Read multi : speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120[/mw_shl_code]
|
|