speedup PW startup restore by setting set process priority to high during the first 10 seconds of PW starting

This commit is contained in:
Kang Yu 2025-05-03 16:33:47 -07:00
parent e8f06c1368
commit 4df563f1bb

View file

@ -48,6 +48,15 @@ if not errorlevel 1 goto wait_to_finish";
[STAThread]
static void Main(string[] args)
{
var process = Process.GetCurrentProcess();
var process_priority = process.PriorityClass;
process.PriorityClass = ProcessPriorityClass.High;
var timer = new System.Threading.Timer(state =>
{
process.PriorityClass = process_priority;
});
timer.Change(10000, System.Threading.Timeout.Infinite);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);