From d21966ecbc8da5a33866be5ffcc8bed1898266bb Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Mon, 30 Mar 2015 14:51:14 +0200 Subject: [PATCH] Revert "tests: Use lowres_clock in time_it()" This reverts commit e605a0368a2e33b5607755eeab5a7d2aab25d1bd. lowres_clock is not updated when reactor is not running and this variant of time_it() is not meant to be run in a rector. --- tests/perf/perf.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/perf/perf.hh b/tests/perf/perf.hh index b63805cca6..c0ef7d8bdd 100644 --- a/tests/perf/perf.hh +++ b/tests/perf/perf.hh @@ -19,10 +19,10 @@ void time_it(Func func, int iterations = 5) { for (int i = 0; i < iterations; i++) { auto start = clk::now(); - auto end_at = lowres_clock::now() + std::chrono::seconds(1); + auto end_at = start + std::chrono::seconds(1); uint64_t count = 0; - while (lowres_clock::now() < end_at) { + while (clk::now() < end_at) { for (int i = 0; i < 10000; i++) { // amortize clock reading cost func(); count++;