mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-09 17:55:23 +00:00
Adding sleep method to ThreadingUtils
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user