version 1.72, 2009/04/11 07:45:48 |
version 1.73, 2010/09/20 11:49:48 |
|
|
if (nreceived && timing) { |
if (nreceived && timing) { |
/* Only display average to microseconds */ |
/* Only display average to microseconds */ |
double num = nreceived + nrepeats; |
double num = nreceived + nrepeats; |
double avg = tsum / num; |
double dev, avg; |
double dev = sqrt((tsumsq - num * avg * avg) / (num - 1)); |
if (num > 1) { |
|
avg = tsum / num; |
|
dev = sqrt((tsumsq - num * avg * avg) / (num - 1)); |
|
} else { |
|
avg = tsum; |
|
dev = 0.0; |
|
} |
(void)printf( |
(void)printf( |
"round-trip min/avg/max/std-dev = %.3f/%.3f/%.3f/%.3f ms\n", |
"round-trip min/avg/max/std-dev = %.3f/%.3f/%.3f/%.3f ms\n", |
tmin, avg, tmax, dev); |
tmin, avg, tmax, dev); |