Floating point exception
注意用float 修饰一下:
{
printf("use time is %ld,%ld \n",(tv2.tv_sec-tv1.tv_sec),(tv2.tv_usec - tv1.tv_usec));
tv3.tv_sec = tv2.tv_sec - tv1.tv_sec;
tv3.tv_usec = tv2.tv_usec - tv1.tv_usec;
}
bps = (float)((224*2)/(tv3.tv_sec +(float)(tv3.tv_usec/1000000)));
printf("\n USB speed is %f Bps\n",bps);
printf("\n received %d bytes\n", size);
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。