Adding sleep method to ThreadingUtils

This commit is contained in:
Chris Cameron
2017-10-01 19:13:57 -04:00
parent 6224e7c8cb
commit ab283cde4e

View File

@@ -12,6 +12,19 @@ namespace ICD.Common.Utils
{
public static class ThreadingUtils
{
/// <summary>
/// Puts the current thread to sleep for the given amount of time.
/// </summary>
/// <param name="milliseconds"></param>
public static void Sleep(long milliseconds)
{
#if SIMPLSHARP
throw new NotImplementedException();
#else
Task.Delay(TimeSpan.FromMilliseconds(milliseconds)).Wait();
#endif
}
/// <summary>
/// Executes the callback as a short-lived, threaded task.
/// </summary>