summaryrefslogtreecommitdiffstats
path: root/vespalog
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-11-19 23:22:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-11-20 21:55:01 +0000
commitcf3b20dba22718b533eac6854cde86b6538958af (patch)
tree9a0e795cd74d2721140c48012f794298dfef7420 /vespalog
parent64b7c822099d7cda921699e380c4d95608a1ab00 (diff)
FastOS_Time -> std::chrono.
Diffstat (limited to 'vespalog')
-rw-r--r--vespalog/src/test/threads/testthreads.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/vespalog/src/test/threads/testthreads.cpp b/vespalog/src/test/threads/testthreads.cpp
index 802514285b6..d23e00930fd 100644
--- a/vespalog/src/test/threads/testthreads.cpp
+++ b/vespalog/src/test/threads/testthreads.cpp
@@ -1,6 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/fastos/app.h>
-#include <vespa/fastos/time.h>
+#include <vespa/fastos/timestamp.h>
#include <vespa/fastos/thread.h>
#include <vespa/log/bufferedlogger.h>
#include <array>
@@ -104,11 +104,10 @@ ThreadTester::Main()
pool.NewThread(loggers[i].get());
}
- FastOS_Time start;
- start.SetNow();
+ fastos::StopWatch timer;
// Reduced runtime to half as the test now repeats itself to test with
// buffering. (To avoid test taking a minute)
- while (start.MilliSecsToNow() < 15 * 1000) {
+ while (timer.elapsed().ms() < 15 * 1000) {
unlink(_argv[1]);
std::this_thread::sleep_for(1ms);
}
@@ -116,8 +115,8 @@ ThreadTester::Main()
for (int i = 0; i < numLoggers; i++) {
loggers[i]->_useLogBuffer = true;
}
- start.SetNow();
- while (start.MilliSecsToNow() < 15 * 1000) {
+ timer.restart();
+ while (timer.elapsed().ms() < 15 * 1000) {
unlink(_argv[1]);
std::this_thread::sleep_for(1ms);
}