aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/tests/timer/timer_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vbench/src/tests/timer/timer_test.cpp')
-rw-r--r--vbench/src/tests/timer/timer_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/vbench/src/tests/timer/timer_test.cpp b/vbench/src/tests/timer/timer_test.cpp
new file mode 100644
index 00000000000..150a8d847d6
--- /dev/null
+++ b/vbench/src/tests/timer/timer_test.cpp
@@ -0,0 +1,16 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/vespalib/testkit/testapp.h>
+#include <vbench/test/all.h>
+
+using namespace vbench;
+
+IGNORE_TEST("timer") {
+ Timer timer;
+ EXPECT_APPROX(0.0, timer.sample(), 0.1);
+ vespalib::Thread::sleep(1000);
+ EXPECT_APPROX(1.0, timer.sample(), 0.1);
+ timer.reset();
+ EXPECT_APPROX(0.0, timer.sample(), 0.1);
+}
+
+TEST_MAIN() { TEST_RUN_ALL(); }