+ if(gettimeofday(&stop, NULL)<0) {
+ retval=-1;
+ snprintf(errstr, errstr_len, "Could not measure end time: %s", strerror(errno));
+ goto err_open;
+ }
+ timespan=stop.tv_sec-start.tv_sec+(stop.tv_usec-start.tv_usec)/1000000;
+ speed=(int)(size/timespan);
+ if(speed>1024) {
+ speed>>=10;
+ speedchar[0]='K';
+ }
+ if(speed>1024) {
+ speed>>=10;
+ speedchar[0]='M';
+ }
+ if(speed>1024) {
+ speed>>=10;
+ speedchar[0]='G';
+ }
+ g_message("Throughput test complete. Took %.3f seconds to complete, %d%sB/s",timespan,speed,speedchar);