From cf3b20dba22718b533eac6854cde86b6538958af Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 19 Nov 2019 23:22:55 +0000 Subject: FastOS_Time -> std::chrono. --- searchlib/src/tests/fef/phrasesplitter/benchmark.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'searchlib/src/tests/fef') 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 #include #include -#include +#include #include 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(); } -- cgit v1.2.3