You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
753 B

using System.Threading;
namespace UnityEditor.PackageManager.UI
{
internal class ThreadedDelay
{
public int Length { get; set; } // In milliseconds
public bool IsDone { get; private set; }
public ThreadedDelay(int length = 0)
{
Length = length;
IsDone = false;
}
public void Start()
{
if (Length <= 0)
{
IsDone = true;
return;
}
IsDone = false;
Thread newThread = new Thread(() =>
{
Thread.Sleep(Length);
IsDone = true;
});
newThread.Start();
}
}
}