diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-03 14:24:41 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-04 18:15:16 +0000 |
commit | 8946dbea418f760e4f0a5cbe2eb2bcbcddd25032 (patch) | |
tree | fc254ea5dea29ddf6a395b8bcdcb8c7540d22238 /fnet/src/examples | |
parent | 7700f411ea6f4a3e7c0599fae239ec84c18c0038 (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')
-rw-r--r-- | fnet/src/examples/timeout/timeout.cpp | 7 |
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); |