diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-16 21:34:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-16 21:34:54 -0600 |
commit | 8a02ad01e25ed2483bd0f1c8abdec8eabf44634a (patch) | |
tree | 253ee93b860f20a9c1deeb4cf0f6a31945bf6bf8 /searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp | |
parent | 2f8e6f0cb74ef77a645e7543975aca736f7649a9 (diff) |
Revert "Balder/remove steadytimestamp 2"
Diffstat (limited to 'searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp')
-rw-r--r-- | searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp index 576c9abe249..65890f81e16 100644 --- a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp +++ b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp @@ -187,21 +187,22 @@ struct FilterFactory : WandFactory { struct Setup { Stats stats; - vespalib::duration minTime; - Setup() : stats(), minTime(10000s) {} + double minTimeMs; + Setup() : stats(), minTimeMs(10000000.0) {} virtual ~Setup() {} virtual std::string name() const = 0; virtual SearchIterator::UP create() = 0; void perform() { SearchIterator::UP search = create(); SearchIterator &sb = *search; - vespalib::Timer timer; + fastos::StopWatch timer; for (sb.seek(1); !sb.isAtEnd(); sb.seek(sb.getDocId() + 1)) { stats.hit(); sb.unpack(sb.getDocId()); } - if (timer.elapsed() < minTime) { - minTime = timer.elapsed(); + double ms = timer.elapsed().ms(); + if (ms < minTimeMs) { + minTimeMs = ms; } } void benchmark() { @@ -212,7 +213,7 @@ struct Setup { stats.print(); } } - fprintf(stderr, "time (ms): %ld\n", vespalib::count_ms(minTime)); + fprintf(stderr, "time (ms): %g\n", minTimeMs); } }; |