if (timing) {
gettimeofday(&after, 0);
-// fprintf(stderr,"%d.%06d\n",(after.tv_sec - before.tv_sec),
-// (after.tv_usec - before.tv_usec));
int newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 +
(after.tv_usec - before.tv_usec) / 100);
int newKbits = n * 8 / 1000;
-// if (newTimeWaited == 0) {
-// fprintf(stderr,"new kbps infinite t %d k %d\n",
-// newTimeWaited, newKbits);
-// } else {
-// fprintf(stderr,"new kbps %d t %d k %d\n",
-// newKbits * 10000 / newTimeWaited, newTimeWaited, newKbits);
-// }
-
// limit rate to between 10kbit/s and 40Mbit/s
if (newTimeWaited > newKbits*1000) newTimeWaited = newKbits*1000;
}
}
- //fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",
- //t.width(),t.height(),t.tl.x,t.tl.y);
pb->imageRect(pf, t, buf);
}
}