Commit 26b139fc authored by Elliott Clark's avatar Elliott Clark Committed by Facebook Github Bot 0

Correctly use iters_ in ProducerConsumerQueueBenchmark

Summary: iters was only being used on one side of the producer/consumer.

Reviewed By: yfeldblum

Differential Revision: D3588593

fbshipit-source-id: 5e9a8a02bb9addbd6f936b8cc411d58cdf82b6e2
parent c17a113e
...@@ -98,15 +98,14 @@ struct LatencyTest { ...@@ -98,15 +98,14 @@ struct LatencyTest {
} }
void computeTimeCost() { void computeTimeCost() {
int iterations = 1000;
timespec start, end; timespec start, end;
clock_gettime(CLOCK_REALTIME, &start); clock_gettime(CLOCK_REALTIME, &start);
for (int i = 0; i < iterations; ++i) { for (int i = 0; i < iters_; ++i) {
timespec tv; timespec tv;
clock_gettime(CLOCK_REALTIME, &tv); clock_gettime(CLOCK_REALTIME, &tv);
} }
clock_gettime(CLOCK_REALTIME, &end); clock_gettime(CLOCK_REALTIME, &end);
time_cost_ = 2 * detail::timespecDiff(end, start) / iterations; time_cost_ = 2 * detail::timespecDiff(end, start) / iters_;
} }
void producer() { void producer() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment