From d817a7407ee9cef2684a9777a0b5d33c6b35a5f3 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 15 Nov 2019 09:42:09 +0000 Subject: Use steady_clock --- staging_vespalib/src/tests/array/allocinarray_benchmark.cpp | 2 +- staging_vespalib/src/tests/array/sort_benchmark.cpp | 2 +- staging_vespalib/src/tests/rusage/rusage_test.cpp | 2 +- staging_vespalib/src/vespa/vespalib/util/rusage.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'staging_vespalib') diff --git a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp b/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp index d222a26c496..5e208864502 100644 --- a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp +++ b/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp @@ -111,7 +111,7 @@ Test::Main() count = strtol(_argv[2], NULL, 0); } TEST_INIT("allocinarray_benchmark"); - fastos::TimeStamp start(fastos::ClockSystem::now()); + fastos::TimeStamp start(fastos::ClockSteady::now()); if (type == "direct") { benchmarkTree(count); } else { diff --git a/staging_vespalib/src/tests/array/sort_benchmark.cpp b/staging_vespalib/src/tests/array/sort_benchmark.cpp index 1914e3ead9e..bdb96567f9e 100644 --- a/staging_vespalib/src/tests/array/sort_benchmark.cpp +++ b/staging_vespalib/src/tests/array/sort_benchmark.cpp @@ -100,7 +100,7 @@ Test::Main() payLoad = strtol(_argv[3], NULL, 0); } TEST_INIT("sort_benchmark"); - fastos::TimeStamp start(fastos::ClockSystem::now()); + fastos::TimeStamp start(fastos::ClockSteady::now()); if (payLoad < 8) { typedef TT<8> T; if (type == "sortdirect") { diff --git a/staging_vespalib/src/tests/rusage/rusage_test.cpp b/staging_vespalib/src/tests/rusage/rusage_test.cpp index 32dc5b42116..503018ee70d 100644 --- a/staging_vespalib/src/tests/rusage/rusage_test.cpp +++ b/staging_vespalib/src/tests/rusage/rusage_test.cpp @@ -30,7 +30,7 @@ Test::testRUsage() RUsage diff = r2-r1; EXPECT_EQUAL(diff.toString(), r2.toString()); { - RUsage then = RUsage::createSelf(17765895674); + RUsage then = RUsage::createSelf(7); RUsage now = RUsage::createSelf(); EXPECT_NOT_EQUAL(now.toString(), then.toString()); } diff --git a/staging_vespalib/src/vespa/vespalib/util/rusage.cpp b/staging_vespalib/src/vespa/vespalib/util/rusage.cpp index 62d0158f784..96a9c7ef206 100644 --- a/staging_vespalib/src/vespa/vespalib/util/rusage.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/rusage.cpp @@ -43,7 +43,7 @@ RUsage RUsage::createChildren() RUsage RUsage::createSelf(const fastos::TimeStamp & since) { RUsage r; - r._time = fastos::TimeStamp(fastos::ClockSystem::now()) - since; + r._time = fastos::TimeStamp(fastos::ClockSteady::now()) - since; if (getrusage(RUSAGE_SELF, &r) != 0) { throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str()); } @@ -53,7 +53,7 @@ RUsage RUsage::createSelf(const fastos::TimeStamp & since) RUsage RUsage::createChildren(const fastos::TimeStamp & since) { RUsage r; - r._time = fastos::TimeStamp(fastos::ClockSystem::now()) - since; + r._time = fastos::TimeStamp(fastos::ClockSteady::now()) - since; if (getrusage(RUSAGE_CHILDREN, &r) != 0) { throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str()); } -- cgit v1.2.3