diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-19 23:22:55 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-20 21:55:01 +0000 |
commit | cf3b20dba22718b533eac6854cde86b6538958af (patch) | |
tree | 9a0e795cd74d2721140c48012f794298dfef7420 /searchlib/src/tests/fef | |
parent | 64b7c822099d7cda921699e380c4d95608a1ab00 (diff) |
FastOS_Time -> std::chrono.
Diffstat (limited to 'searchlib/src/tests/fef')
-rw-r--r-- | searchlib/src/tests/fef/phrasesplitter/benchmark.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/searchlib/src/tests/fef/phrasesplitter/benchmark.cpp b/searchlib/src/tests/fef/phrasesplitter/benchmark.cpp index c789fb582ec..bed5d656b93 100644 --- a/searchlib/src/tests/fef/phrasesplitter/benchmark.cpp +++ b/searchlib/src/tests/fef/phrasesplitter/benchmark.cpp @@ -6,7 +6,7 @@ #include <vespa/searchlib/fef/matchdatalayout.h> #include <vespa/searchlib/fef/phrasesplitter.h> #include <vespa/searchlib/fef/test/queryenvironment.h> -#include <vespa/fastos/time.h> +#include <vespa/fastos/timestamp.h> #include <vespa/log/log.h> LOG_SETUP("phrasesplitter_test"); @@ -16,11 +16,11 @@ namespace search::fef { class Benchmark : public vespalib::TestApp { private: - FastOS_Time _timer; - double _sample; + fastos::StopWatch _timer; + fastos::TimeStamp _sample; - void start() { _timer.SetNow(); } - void sample() { _sample = _timer.MilliSecsToNow(); } + void start() { _timer.restart(); } + void sample() { _sample = _timer.elapsed(); } void run(size_t numRuns, size_t numPositions); public: @@ -69,13 +69,13 @@ Benchmark::Main() return 0; } - size_t numRuns = strtoull(_argv[1], NULL, 10); - size_t numPositions = strtoull(_argv[2], NULL, 10); + size_t numRuns = strtoull(_argv[1], nullptr, 10); + size_t numPositions = strtoull(_argv[2], nullptr, 10); run(numRuns, numPositions); - std::cout << "TET: " << _sample << " (ms)" << std::endl; - std::cout << "ETPD: " << std::fixed << std::setprecision(10) << _sample / numRuns << " (ms)" << std::endl; + std::cout << "TET: " << _sample.ms() << " (ms)" << std::endl; + std::cout << "ETPD: " << std::fixed << std::setprecision(10) << _sample.ms() / numRuns << " (ms)" << std::endl; TEST_DONE(); } |