summaryrefslogtreecommitdiffstats
path: root/fnet/src/examples/timeout/timeout.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-03 14:24:41 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-12-04 18:15:16 +0000
commit8946dbea418f760e4f0a5cbe2eb2bcbcddd25032 (patch)
treefc254ea5dea29ddf6a395b8bcdcb8c7540d22238 /fnet/src/examples/timeout/timeout.cpp
parent7700f411ea6f4a3e7c0599fae239ec84c18c0038 (diff)
FastOS_THread::Sleep -> std::chrono::sleep_for
Renamed Timer -> ScheduledExecutor. Do not include thread.h when not needed in header files.
Diffstat (limited to 'fnet/src/examples/timeout/timeout.cpp')
-rw-r--r--fnet/src/examples/timeout/timeout.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fnet/src/examples/timeout/timeout.cpp b/fnet/src/examples/timeout/timeout.cpp
index 1d6ecc11909..23dfbeb9070 100644
--- a/fnet/src/examples/timeout/timeout.cpp
+++ b/fnet/src/examples/timeout/timeout.cpp
@@ -2,7 +2,8 @@
#include <vespa/fnet/fnet.h>
#include <vespa/fastos/app.h>
-#include <chrono>
+#include <vespa/vespalib/util/time.h>
+#include <thread>
#include <vespa/log/log.h>
LOG_SETUP("timeout");
@@ -55,7 +56,7 @@ MyApp::Main()
transport.Start(&pool);
// stable-state operation
- FastOS_Thread::Sleep(500);
+ std::this_thread::sleep_for(500ms);
FNET_Packet *packet;
FNET_Context context;
@@ -64,7 +65,7 @@ MyApp::Main()
t = clock::now();
timeout.Schedule(2.0); // timeout in 2 seconds
- FastOS_Thread::Sleep(1000);
+ std::this_thread::sleep_for(1s);
timeout.Unschedule(); // cancel timeout
ms = (clock::now() - t);