diff options
Diffstat (limited to 'vespalog')
-rw-r--r-- | vespalog/src/test/threads/testthreads.cpp | 11 |
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); } |