From ab283cde4eb3b2dd1c9237a51a2bc5bb61ede31a Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Sun, 1 Oct 2017 19:13:57 -0400 Subject: [PATCH] Adding sleep method to ThreadingUtils --- ICD.Common.Utils/ThreadingUtils.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ICD.Common.Utils/ThreadingUtils.cs b/ICD.Common.Utils/ThreadingUtils.cs index 2ef5ccf..8ecb48e 100644 --- a/ICD.Common.Utils/ThreadingUtils.cs +++ b/ICD.Common.Utils/ThreadingUtils.cs @@ -12,6 +12,19 @@ namespace ICD.Common.Utils { public static class ThreadingUtils { + /// + /// Puts the current thread to sleep for the given amount of time. + /// + /// + public static void Sleep(long milliseconds) + { +#if SIMPLSHARP + throw new NotImplementedException(); +#else + Task.Delay(TimeSpan.FromMilliseconds(milliseconds)).Wait(); +#endif + } + /// /// Executes the callback as a short-lived, threaded task. ///