summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-11-15 09:42:09 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-11-15 09:42:09 +0000
commitd817a7407ee9cef2684a9777a0b5d33c6b35a5f3 (patch)
treea9931a75cfd117c429a197ecb2470f5138c90e72 /staging_vespalib
parenta3a13616e52c4ac3c97b572c81e485bb0f81295b (diff)
Use steady_clock
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/tests/array/allocinarray_benchmark.cpp2
-rw-r--r--staging_vespalib/src/tests/array/sort_benchmark.cpp2
-rw-r--r--staging_vespalib/src/tests/rusage/rusage_test.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/rusage.cpp4
4 files changed, 5 insertions, 5 deletions
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());
}