perf: compute average throughput correctly