From 37a7a4b87a8bef6799e8f2727c420ff7ba4895e5 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Thu, 10 Aug 2023 22:14:57 +1000 Subject: [PATCH] . --- src/util/precise_sleep.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/util/precise_sleep.cpp b/src/util/precise_sleep.cpp index 8b87cebc9..e47a0d7f8 100644 --- a/src/util/precise_sleep.cpp +++ b/src/util/precise_sleep.cpp @@ -1,8 +1,5 @@ #include "precise_sleep.hpp" -namespace NUClear { -namespace util { - #if defined(_WIN32) #include @@ -10,10 +7,8 @@ namespace util { #include "platform.hpp" - // Keep this include here - #ifdef _WIN32 - #include - #endif +namespace NUClear { +namespace util { void precise_sleep(const std::chrono::nanoseconds& ns) { ::LARGE_INTEGER ft; @@ -28,12 +23,18 @@ namespace util { ::CloseHandle(timer); } +} // namespace util +} // namespace NUClear + #else #include #include #include +namespace NUClear { +namespace util { + void precise_sleep(const std::chrono::nanoseconds& ns) { struct timespec ts; ts.tv_sec = std::chrono::duration_cast(ns).count(); @@ -43,7 +44,7 @@ namespace util { } } -#endif - } // namespace util } // namespace NUClear + +#endif