latency.add(te.getReceiveTime(m) - te.getSendTime(m));
}
}
MessageBenchmarkStats res = new MessageBenchmarkStats();
res.totalTime = (receiveTime.getMax() - sendTime.getMin()) / TimeUnit.SECONDS.toMillis(1);
res.throughput = n / res.totalTime;
res.averageLatency = latency.getMean();