Fix integer overflow error when calculating throughput.

This commit is contained in:
Ilya Kulakov 2016-02-03 19:00:51 +06:00
parent 77f5344ff7
commit d7e59d6188

View File

@ -118,7 +118,7 @@ int main (int argc, char *argv [])
throughput = (unsigned long)
((double) message_count / (double) elapsed * 1000000);
megabits = (double) (throughput * message_size * 8) / 1000000;
megabits = ((double) throughput * message_size * 8) / 1000000;
printf ("message size: %d [B]\n", (int) message_size);
printf ("message count: %d\n", (int) message_count);