mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Adding sleep method to ThreadingUtils
This commit is contained in:
parent
6224e7c8cb
commit
ab283cde4e
1 changed files with 13 additions and 0 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue