aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-11-18 22:44:04 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-11-20 10:16:58 +0000
commit55069682323b0c204b2ddda696bfcd33f4e47a64 (patch)
tree508042cdb977ec9ea3c6323e8727aa149e09ba54 /searchsummary
parent95432b0ec4be8e844fe5433598a9045d0de08fef (diff)
Use C++11 chrono instead prehistoric homegrown stuff.
Diffstat (limited to 'searchsummary')
-rw-r--r--searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp b/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
index b2920b39eaf..b414671748c 100644
--- a/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
+++ b/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
@@ -3,7 +3,7 @@
#include "extractkeywordstest.h"
#include <vespa/searchsummary/docsummary/keywordextractor.h>
#include <vespa/searchlib/parsequery/simplequerystack.h>
-#include <vespa/fastos/time.h>
+#include <vespa/fastos/timestamp.h>
#define NUMTESTS 5
@@ -94,11 +94,10 @@ ExtractKeywordsTest::Main()
int testCnt = 0;
// init keyword extractor
- _extractor = new search::docsummary::KeywordExtractor(NULL);
+ _extractor = new search::docsummary::KeywordExtractor(nullptr);
_extractor->AddLegalIndexSpec("*");
- FastOS_Time timer;
- timer.SetNow();
+ fastos::StopWatch timer;
// Actually run the tests that we wanted.
for (int j = 0; j < multiplier; j++)
@@ -110,7 +109,7 @@ ExtractKeywordsTest::Main()
}
// Print time taken
- double timeTaken = timer.MilliSecsToNow();
+ double timeTaken = timer.stop().elapsed().ms();
printf("Time taken : %f ms\n", timeTaken);
printf("Number of tests run: %d\n", testCnt);
@@ -118,7 +117,7 @@ ExtractKeywordsTest::Main()
printf("Tests pr Sec: %f\n", avgTestPrMSec * 1000.0);
delete _extractor;
- _extractor = NULL;
+ _extractor = nullptr;
return failed ? 1 : 0;
}
@@ -159,8 +158,8 @@ ExtractKeywordsTest::RunTest(int testno, bool verify)
{
search::SimpleQueryStack stack;
search::RawBuf buf(32768);
- const char *correct = NULL;
- const char *keywords = NULL;
+ const char *correct = nullptr;
+ const char *keywords = nullptr;
switch (testno) {
case 0: