aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/tests/clock/clock_benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'staging_vespalib/src/tests/clock/clock_benchmark.cpp')
-rw-r--r--staging_vespalib/src/tests/clock/clock_benchmark.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/staging_vespalib/src/tests/clock/clock_benchmark.cpp b/staging_vespalib/src/tests/clock/clock_benchmark.cpp
index c8d3e2a5aff..a51d83ae4dc 100644
--- a/staging_vespalib/src/tests/clock/clock_benchmark.cpp
+++ b/staging_vespalib/src/tests/clock/clock_benchmark.cpp
@@ -139,17 +139,16 @@ main(int , char *argv[])
NSVolatile nsVolatile;
NSAtomic nsAtomic;
vespalib::InvokeServiceImpl invoker(vespalib::from_s(1.0/frequency));
- Clock clock;
+ Clock clock(invoker.nowPtr());
TestClock nsClock(nsValue, 1.0/frequency);
TestClock nsVolatileClock(nsVolatile, 1.0/frequency);
TestClock nsAtomicClock(nsAtomic, 1.0/frequency);
- clock.start(invoker);
assert(pool.NewThread(&nsClock, nullptr) != nullptr);
assert(pool.NewThread(&nsVolatileClock, nullptr) != nullptr);
assert(pool.NewThread(&nsAtomicClock, nullptr) != nullptr);
benchmark("vespalib::Clock", pool, samples, numThreads, [&clock]() {
- return clock.getTimeNSAssumeRunning();
+ return clock.getTimeNS();
});
benchmark("uint64_t", pool, samples, numThreads, [&nsValue]() {
return steady_time (duration(nsValue._value));
@@ -175,6 +174,5 @@ main(int , char *argv[])
});
pool.Close();
- clock.stop();
return 0;
}