mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
Adding sleep method to ThreadingUtils
This commit is contained in:
@@ -12,6 +12,19 @@ namespace ICD.Common.Utils
|
|||||||
{
|
{
|
||||||
public static class ThreadingUtils
|
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>
|
/// <summary>
|
||||||
/// Executes the callback as a short-lived, threaded task.
|
/// Executes the callback as a short-lived, threaded task.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user